Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


EllenC
2014-09-01T19:09:30Z
Greetings,

I have a user who wants to use Visual Cron to launch a batch file. The bat file works from a cmd line and most of it appears to work from VC, but xcopy doesn't appear to be.

I have created a short VC test file that contains lines like

xcopy /?
C:\Windows\System32\xcopy.exe /?
(and the above line items in double quotes)
xcopy /path/to/dir/afile.txt
(and some other examples)


I am not seeing any results or error messages
The bat file has the working directory set to where the bat file is.
It is set to run in the foreground.
It uses a local user credential.

He really wants to use xcopy inside a bat file and not the visual cron features.

What am I missing?

Sponsor
Forum information
Support
2014-09-02T07:15:40Z
Try to use full paths to xcopy command rather than to rely on the working directory. I am sure it is something about paths and the files not being found. If you hard code the paths for xcopy I think it will work.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
EllenC
2014-09-02T15:20:30Z
I've been working on that theory, but C:\Windows\System32\xcopy.exe /?
is a full path and the supplied user credential would have had that in the path anyway so I'm a little stumped.
Support
2014-09-02T15:44:50Z
Are you copying to or from a network drive? Then try to copy local first, just to confirm it is working.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
EllenC
2014-09-02T15:59:22Z
I now have copied xcopy.exe locally, but it's still acting the same way.
It claims to have run it, but there is no output from it on either stdout or stderr even if I call it without any parameters just to see an error response, yet stdout is working when using a wmic query as a test.

Here is one stdout example (this is the output, not the script but the script looks similar):


D:\users\Ellen\Scripts\Temp>d:\users\ellen\Scripts\Temp\xcopy.exe
[should have seen an error message here.]

D:\users\Ellen\Scripts\Temp>xcopy.exe /?
[should have seen the help message here.]

D:\users\Ellen\Scripts\Temp>wmic computersystem get username
UserName
DGILINUX\ellen
EllenC
2014-09-02T17:48:23Z
If I switch the task to Background execution then xcopy works (full path not needed with a credential), also a test reg query works.

However a test:
wmic computersystem get username
only works as a Foreground execution - the output is cut off even with Get Full Output.

Can you explain the difference between Foreground and Background execution?

EllenC
2014-09-02T23:50:00Z
I have replaced xcopy with robocopy, which runs in the foreground without issue.
Scroll to Top