But have you ever tried using wildcards in the source path?
From the GPP help:
Source file(s) Type the location from which to copy the Source file(s). This location can be a fully qualified UNC path or a path on a local or mapped drive from the perspective of the client. This field can contain variables.
This field can also contain single character (?) and multiple character (*) wildcards, allowing you to copy or modify multiple files.
This option is available only if the action selected is Create, Replace, or Update.
Only just noticed this, but if you put a * in the path the 'Destination file' box is relabelled to 'Destination folder' (not completely intuitive!)
So yeah you put source = "\\some_server_share\files\*" and destination = "c:\files_here_please" and all the files would be copied from the server share to the local machine.
If im scripting a file / folder copy in the script I usually add a drive mount, and then once the copy is finished do a "net use * /del /yes" or only dismount the drive im copying from.
I hope you get what I mean, It seems to be the quickest way I've found of doing things like this. I have a logon tracker that does just this except it writes to a log file rather than copy a file.
So when a user logs in the drive is mounted then the logon details of that user using variables like time, date. machine name, user name etc are all added to the log file and its all done that quick the users never see the mapped drive, and if they try to access it they cant anyway.
Hope this helps.
Ok, heres a question. Say the script is running in the background, is halfway through and then suddenly...i dunno, the battery goes on the netbook, or a kid turns the machine off.
Does it compare the folders when checking ifexist? Im just thinking, if the folder is there but half the files are missing what does it do?
Batch file-wise, you're looking at FOR /F
Last edited by X-13; 27th September 2012 at 09:19 PM.
No, that's why you should make an MSI, it's an entire system designed over 10 years to copy files with no errors.
Couldn't you make it in to a package and deploy the package?
There are currently 1 users browsing this thread. (0 members and 1 guests)