Jump to content

FileMove


Recommended Posts

Trying to move a file from a server to "All Users" folder, and replace existing. Runs but does not move the file.

Source, destination, and flag OK?

Thank for any assistance.

FileMove("\\server\folder1\folder2\testmovefile*", "C:\Documents and Settings\All Users\Application Data\folder1\folder2\testmovefile*", 1)
Link to comment
Share on other sites

Trying to move a file from a server to "All Users" folder, and replace existing. Runs but does not move the file.

Source, destination, and flag OK?

Thank for any assistance.

FileMove("\\server\folder1\folder2\testmovefile*", "C:\Documents and Settings\All Users\Application Data\folder1\folder2\testmovefile*", 1)
If you are going to use wildcards in the source, only give the folder for the destination with the trailing backslash:

FileMove("\\server\folder1\folder2\testmovefile*", "C:\Documents and Settings\All Users\Application Data\folder1\folder2\", 1+8)

The help file for FileMove() plainly says you can use wildcards in the destination, but I'm not sure how that would work or what the resolution logic would be.

:)

Edit: Added +8 to the parms for create directories as requiered, per lod3n. Still don't get the wildcard in the destination though...

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Thanks for the replies

I should have been using FileCopy in the first place. The code below works great btw. (overwriting same file name w/new data on the exisiting directory)

FileCopy("\\server\folder1\folder2\testmovefile*", "C:\Documents and Settings\All Users\Application Data\folder1\folder2\", 9)

Have a great weekend.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...