Thread: finding and copying

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    224

    finding and copying

    could someone show me the source of a program that would search for a file then copy it to a folder.
    thx

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    It varies from system to system. You need to give us more information.


    We won't provide any help unless you make an effort to do it yourself.

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    its for a windows OS
    i need it to find files on my computer like *.DOC files that my reports are in and move them to another folder so i can find them easier.
    and to tell the truth i dont really even know were to start
    Last edited by c++.prog.newbie; 06-11-2003 at 08:22 PM.

  4. #4
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Look into WinAPI. Also, there is a thread on the C++ board about deleting folders that may give you a starting point.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  5. #5
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    i was hoping it would be a program that ran minimized in dos or something that doesnt need user input

  6. #6
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    Go to start menu, select find, and search for '*.doc'

    Then, select all of the results, select cut, and paste them in a folder of your choice.

  7. #7
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    thats to easy though.
    and i was hoping i could use this to learn how to use the copy and find functions.

  8. #8
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Look into file and folder functions in WinAPI. MSDN will undoubtedly have documentation on this.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  9. #9
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    could you tell me how to get to them

  10. #10
    Casual Visitor
    Join Date
    Oct 2001
    Posts
    350
    If your interested in dos, lookup findfirst() or similar in a dos compiler's help section.
    Mill about in same from MSDN - http://msdn.microsoft.com/library/de...ndfirsti64.asp

    You could always write a batch file to do that.

    copy drive:\directory\*.doc drive:\new directory

    use dos's 8.3 format
    I haven't used a compiler in ages, so please be gentle as I try to reacclimate myself. :P

  11. #11
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Alternatively, this thread discussed finding and deleting files. If you replace the DeleteFile() API call with the MoveFile() call.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  12. #12
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    thx but could you give me or tell me were to find the parameters for MoveFile()

  13. #13
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    what header do i need for MoveFile().

  14. #14
    Registered User
    Join Date
    Dec 2002
    Posts
    221
    did you even bother to look up the function at all on msdn?

  15. #15
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    Originally posted by Salem
    Meditative "Aummmm"
    for this source (the msvc++) how do i make it look from the root dir. of the computer and not were the program is.

    so rather than it searching from.
    c:\...\\<place were program is>
    it will search from.
    c:\
    and have the file anywere

Popular pages Recent additions subscribe to a feed