Sign in to follow this  
Followers 0
tonysing

Copying folder by xcopy

3 posts in this topic

Hi guys,

I am trying to copy a folder(with loads of stuff related to java) from one harddisk to another one. But things goes wrong even with this simple script. This is the main part:

RunWait(@ComSpec & ' /c Xcopy /S/I/E/Y/T ' & $deploymentFolder_2008 & " " & $AppDataLocalLow)

The targeted folder is quite large (100-200MB). The script will run automatically every time when the someone has logged on. It turns out that it only create a empty folder and copy one file for me.

However, at the moment I test it, it has no issue at all. I wonder what make it goes wrong. Admin right? File size? Or something else?

I have try to do the same thing with dircopy/filecopy, but it gives the same behavior.

DirCopy($deploymentFolder_2008, $AppDataLocalLow,1)

Share this post


Link to post
Share on other sites



Try to add double quotes for the source and destination :

RunWait(@ComSpec & ' /c Xcopy /S/I/E/Y/T "' & $deploymentFolder_2008 & '" "' & $AppDataLocalLow & '"')

Is there an error with xcopy ? what is the resut of the command (with /k instead of /c) ?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

When I use dircopy, it does has return an error code. 

But for xcopy, no error message at all. When I run the script with your change, still nothing change.

The script give a clean cmd window pop out, without any running code on it

Now not the clean thing, the cmd windows shows File not found - Common

Edited by tonysing

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  
Followers 0