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


ppeel
  •  ppeel
  • No customer Topic Starter
2012-05-08T17:28:33Z
I have a .cmd file that I'm trying to automate using VC. It runs perfectly when I double click on it. However when trying to execute it via VC, I get a return code of -12.
Sponsor
Forum information
Support
2012-05-08T18:13:14Z
Assume you are using the latest version, please make sure:

1. that you run the Execute Task with a Credential
2. when you edit the Credential, that you have "Local logon" and "Load profile" checked
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ppeel
  •  ppeel
  • No customer Topic Starter
2012-05-08T18:25:01Z
We are on version 6.1.0 and yes to both #1 & #2.
Support
2012-05-08T18:28:29Z
-12 is unknown to us. I suggest you add logging in the cmd file to see which row it fails on. Then we can go from there - depending on what it does on that row.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ppeel
  •  ppeel
  • No customer Topic Starter
2012-05-09T11:11:03Z
The cmd file only contains 1 command line as follows:
SFQuery.exe parameters=d:\dev\Employee_Express\Data\Parm\runpdf.xml

I'm thinking it must be syntax. Something Visual Cron doesn't like or interprets differntly than when it's executed outside of VC.
UI've tried just executing the SFQuery.exe as the Command in VC and using the "parameters=..." as the Arguments. Whatever I try I still get the -12 error.

Support
2012-05-09T11:13:29Z
Ok, try these alternatives

1. Use the full path to SFQuery.exe in cmd file
2. set the working directory in execute Task to the folder where SFQuery resides
3. use Execute Task and insert full path to SFQuery.exe in command line and the reset in argument field
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ppeel
  •  ppeel
  • No customer Topic Starter
2012-05-09T11:29:30Z
I think I already tried those suggestions, but I just tried them again. Still get same error.



ppeel attached the following image(s):
Support
2012-05-09T11:31:04Z
Is the domain really called "DOMAIN"?

Also, could you show a screen shot of the Credential settings when editing that Credential?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ppeel
  •  ppeel
  • No customer Topic Starter
2012-05-09T11:50:27Z
That is what I have always used in the past. I have many other jobs that execute .cmd files and they use the same credentials with success.
ppeel attached the following image(s):
Support
2012-05-09T12:01:02Z
If you click on the ADD button in the Credential window. What does it say on Domain then? Use that value in your Credential.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ppeel
  •  ppeel
  • No customer Topic Starter
2012-05-09T12:06:05Z

i just changed the credentials to what I thought the domain should be and reran the task. This time I got an return code of 1326.
ppeel attached the following image(s):
Support
2012-05-09T12:07:23Z
The domain is probably not what you thought it should be. Please look in the Add window again and use that value.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ppeel
  •  ppeel
  • No customer Topic Starter
2012-05-09T12:57:28Z
Okay. With the help of my co-worker, I've now got it down to a return code 2. Attaching the Task Window. It's not finding a file I think. Something wrong with the syntax of the Argument perhaps?

ppeel attached the following image(s):
Support
2012-05-09T13:09:45Z
Yes, you need to use full path to sfquery.exe
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ppeel
  •  ppeel
  • No customer Topic Starter
2012-05-09T13:16:46Z
As soon as I put the full path in, I get the return code -12
ppeel attached the following image(s):
Support
2012-05-09T13:19:34Z
Could be interesting to know - what happens if you:

1. move the xml file to c:\ and change the parameter accordingly
2. remove the parameter totally

What kind of errors do you get in the above cases?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ppeel
  •  ppeel
  • No customer Topic Starter
2012-05-09T13:54:49Z
Tried both. VC shows the STATUS AND RESULT as "Running" but I don't get any output and it doesn't seem to end, like it's in a loop. So I stop the Task and the Result then says Success.

Stonefield Query software requires the word parameters in the argument. To me it seems Stonefield is not reading the xml file correctly. Not sure it is their issue though since it works perfectly when I run the .cmd file independently of VC.
Support
2012-05-09T14:03:21Z
If we could reproduce it here it would be great but clearly -12 is an error that Stonefield Query returns. Maybe they can say why? Perhaps the have some strange licensing bound to a specific user or something.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ppeel
  •  ppeel
  • No customer Topic Starter
2012-05-09T15:46:25Z
Just wanted to let you know that I did get this task to run under Visual Cron thanks to the help of my co-worker and your assistance too Henrik.
I had to run the task as Foreground execution and attached is a screen shot of the Execute Task screen. Works great now! Love it when it finally all comes together!

Thanks for your assistance. I love Visual Cron and I knew we could get it to work if we just hit the right combination.

Thanks again!
ppeel attached the following image(s):
Support
2012-05-09T17:02:20Z
Glad it worked! On a side note I believe that Foreground mode should be avoided as there are some disadvantages. For example, someone needs to be logged in order to run the Task. This can be automated but is more error prone than background automation.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top