xcopy problem/question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using this:
Shell "xcopy \location\*.xls \location /E", vbhide

to move some files before they get replaced by the new daily set. The
problem is, when I shut down my pc at the end of the day I get messages that
xcopy can not shut down by itself. I don't want to confuse the users.

Is there an additional line I need to close/stop the function?
 
The actual code is: Call Shell("xcopy \\server\data\DailyReports\current\*.*
\\server\data\DailyReports\archive /E", vbHide)

xcopy still shows as a running in task manager. I am not sure how to stop
it.

Thanks,
John
 
Check to see if your version of Windows has the new Robocopy (Robust File
Copy for Windows), which has an argument to close.

Otherwise, try to place your xcopy command on a batch file including the
EXIT command and just call the batch file from windows. (Did not test, but I
think it should work).
 
Thank you! Pieter, the /Y is just the ticket. I added that and voila all is
well. Thanks very much.

Victor, thanks, I am checking now to see if we have robocopy for future
reference. I thought of the batch file but was unsure of how to call it via
vba :) I am still learning.
 
Back
Top