Jump to content
Sign in to follow this  
FMS

copy map to another location

Recommended Posts

Dear reader,

I recently made a simple script to copy files to another location for backup services.

While 1
    $search = FileFindFirstFile("C:\test\*.pdf")

    If $search = -1 Then
        sleep(60000)
    Else
        $file = FileFindNextFile($search)
        filemove("C:\test\" & $file,"Z:\test",8)
    EndIf

    FileClose($search)
WEnd

now there are not only pdf files in the dir "test" but more files (.exe , .bat etc)  and sub dir like C:testtest2

I would like to also copy the directory's to the other location but don't understand how....

Zould somebody please help me or point me in the wright direction :)

greez

FMS


as finishing touch god created the dutch

Share this post


Link to post
Share on other sites

Just to clarify, are you asking how to monitor a directory and if a new file is found move just that file? Or move the whole directory? Or just the pdf files? Can you please be a bit more specific?

Edited by JLogan3o13

Share this post


Link to post
Share on other sites

Rather than re-write something, I would suggest you take a look at this thread where Melba presents a solid example of monitoring a directory. I would also encourage you to think about keeping a running list of the files in the directory (written to a text file, kept in an array, etc.) so that you're only moving those files that have been added. This will cause a lot less overhead than moving the entire directory each time.

'?do=embed' frameborder='0' data-embedContent>>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...