Community forum

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


DZ
  •  DZ
  • No customer Topic Starter
2012-10-08T12:03:55Z
Dear all

Trying to remote execute a batch file from our visual cron (5.7.4) server Server 1 (2008 R2), to Server2 (2008 R2). When I start the batch file manually or by task scheduler from the Server2 it works fine.

When the task is run either scheduled or manually from VC it reports success and gives alwas a PID, but it doesn't actually run on the remote server.

Configuration of the remote execution:

Account: serviceAccount@domain
Hostname: Server2 <-- the server name
Command: D:\Application Batches\Test.bat

I created another batch file with an easy command, this doesn't work neither. However I see in the event viewer of Server2 that the process was created, but nothing happens.

The service account is a domain account & local admin on Server2.

Where is here the problem?

Thanks
Matthias
Sponsor
Forum information
Support
2012-10-08T12:09:35Z
Hi,

the reasons could be many. One important difference is that Remote execution uses WMI (Windows Management Instrumentation). This has some limits and context of execution is a bit different. For example, if you are trying to access mapped drives they may not be accessible in remote execution mode unless you mount them there.

Later versions like version 6.1.3 gives you the correct exit code. Previous versions only tell if process started ok.

Also, finally, to really now the reason why it fails we recommend that you add debugging and write to a file on each line. This way you will see exactly which line it fails on - then it will be a lot easier to tell the real reason and solve the problem.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
DZ
  •  DZ
  • No customer Topic Starter
2012-10-08T13:01:33Z
Hi Henrik

Actually I don't access to a mapped drive.

Account: serviceAccount@domain
Hostname: Server2 <-- the server name
Command: D:\Application Batches\Test.bat <-- direct link into file system of Server2

Debugging the batch file seems to be difficult because when I start the VC job on Server1 I can see on Server2's task manager two new processes (conhost.exe and cmd.exe) but it does not execute the batch file (tested with echo and > log.txt)

Installing a new VC version would be fine, just not the next days:-)

What else can I try?

Regards
Matthias
Support
2012-10-08T17:48:38Z
Instead of just using echo > log.txt specify a full path like

echo > c:/log.txt

I guess your previous log.txt ended up in system or temp folder or something else.

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
DZ
  •  DZ
  • No customer Topic Starter
2012-10-09T06:36:52Z
The logfile is in the same folder and it works when it is executed manually. Anyway I tried it with an absolute path, still the same problem: the processes are created but nothing happens...
Support
2012-10-09T06:42:02Z
When executed manually it probably has another working directory. If not even a log file can be created I find it hard to debug this issue.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
DZ
  •  DZ
  • No customer Topic Starter
2012-10-17T09:53:49Z
In this case it is easier to handle it with a scheduled windows task. Maybe next try with a new VC relase with the better exit code.

Thanks for support!
regiscb
2012-10-17T12:51:46Z
I have a very similar problem. In my case, the task runs on the remote server, but not always retrieves the VC Exit Code, which ends up causing failure "Incorrect function.Exception in Task: Non zero exit code." I'm like the last line in the bat file command "EXIT / B 0." This problem is bothering me a lot because the task was performed, and the VC notified as an error. (sorry for bad english)
Support
2012-10-17T13:33:11Z
Originally Posted by: regiscb 

I have a very similar problem. In my case, the task runs on the remote server, but not always retrieves the VC Exit Code, which ends up causing failure "Incorrect function.Exception in Task: Non zero exit code." I'm like the last line in the bat file command "EXIT / B 0." This problem is bothering me a lot because the task was performed, and the VC notified as an error. (sorry for bad english)



I think you need to debug log to file. It probably exits with error before your "nice" exit.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
regiscb
2012-10-17T13:41:04Z
I already do this for each command line in BATCH, with the command >> LOG.TXT (no problems)
Support
2012-10-18T16:40:45Z
Originally Posted by: regiscb 

I already do this for each command line in BATCH, with the command >> LOG.TXT (no problems)



Sounds really strange. I see no way we could return that unless it fails earlier. Can you reproduce this? And what is the reason for using the exit command? Because, if it fails earlier it will exit with other exit code anyway. Unless you jump in code.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top