Dont use the cmd.exe command :like cmd.exe /c copy, xcopy,
How to copy the folder?
Why not use the cmd command ?
1.Sometimes called cmd.exe will fail ,or it is the system problem or patches, but exist。
2.Use the cmd command in the script, if not the last sentence Even if failed, exit code also does not have capture to the error code, the console displays status to completely still and exit code is 0 。
So is there any command to copy the folder, like “cmd.exe md" can use " folder create".
I think I met a bug,
1.There are multiple waithidden script ,
waithidden cmd.exe /c command…
xxxx
waithidden cmd.exe /c command…
xxxx
waithidden cmd.exe /c command…
xxxxxxx
The console will only report last waithidden state, no matter in front of the execution, Situation
is caused by many waithidden fails, the last waithidden success, and only when the console is also showed complete and exit code is 0 。
2.actionscript dos command
dos xcopy source-folder des-folder
Test a source directory does not exist , The client log shows Command succeeded.And there is no any exit code information 。
But using CMD :
waithidden cmd.exe /c xcopy source-folder des-folder
The client log shows:Command succeeded (Exit Code=4), Exit Code non-zero Said there is an error occurred ?
So now I don’t know what the script in the event of a fault can immediately inform the console,
The console will only report last waithidden state, no matter in front of the execution, Situation
is caused by many waithidden fails, the last waithidden success, and only when the console is also showed complete and exit code is 0 。
2.actionscript dos command
Test a source directory does not exist , The client log shows Command succeeded.And there is no any exit code information 。
But using CMD :
The client log shows:Command succeeded (Exit Code=4), Exit Code non-zero Said there is an error occurred ?
So now I don’t know what the script in the event of a fault can immediately inform the console,
The exit code of 4 with the ‘waithidden cmd.exe’ appears to be the correct response for the given scenario where the source directory does not exist, and is coming from xcopy:
I think @Aram has the correct solution for checking the exit code from each waithidden command.
I’d note as well though, that the “copy” command is provided by the cmd.exe shell; but “xcopy.exe” is a standalone binary. You should be able to execute the xcopy command without spawning a cmd shell, if that makes it any easier…
waithidden xcopy.exe /y source destination
I’ve had strange behavior from the waithidden command, when the command line contains more than one set of doublequotes (like doublequoting both the source and destination). In those cases I use a ‘createfile’ or ‘appendfile’ to build a batch on the fly, and execute the batch file with waithidden.