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.


bv749
  •  bv749
  • Paid support Topic Starter
2013-05-09T12:12:17Z
I have a vbscript that creates a file that I want to schedule through visual cron.

The script works fine when I run it outside of visual cron.

When I put it in an "Execute Script" task. It seems to run, but the file is not created.

The credentials for the task are the same that I am running the script outside of visual cron.

I have tried this with other scripts that perform a similar function, with the same result.

Occasionally the task will give an error that the script ended with a nonzero result, but most of the time it shows that it ran successfully.

Has anyone been able to get a vbscript to execute successfully?

I am on 6.2.0.
Sponsor
Forum information
Support
2013-05-09T17:28:39Z
What we suggest is that you comment out everything in the script. Then start adding line by line. It will then be very evident which line is causing the problem.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bv749
  •  bv749
  • Paid support Topic Starter
2013-05-09T17:44:05Z
I stripped down the script to a bare minimum:

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("testfile.csv")

objFile.WriteLine "This is a test"




No file is creates and the results in the logfile are:
Exception in Task: Non zero exit code

This same script works when run outside of Visual Cron.
Support
2013-05-09T17:46:26Z
Try writing the full path to the testfile.csv
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bv749
  •  bv749
  • Paid support Topic Starter
2013-05-09T17:48:33Z
Changed script to:

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("c:\priyal\testfile.csv")

objFile.WriteLine "This is a test"




Still the same results.
Support
2013-05-09T17:52:30Z
Strange - because I had no problems running your script through the Execute script Task.

I ran it without Credentials and the VisualCron service is running as SYSTEM account.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bv749
  •  bv749
  • Paid support Topic Starter
2013-05-09T18:18:28Z
I installed 6.2.2.

The re-install set the service back to run under the SYSTEM.

I ran the job and it worked.

I changed the service to run back under my Vcron service account.

I ran the job and it did NOT work

I then changed the service back to run under SYSTEM.

I ran the job and it did NOT work.


baffled???
Support
2013-05-09T18:34:47Z
Probably some kind of access problem or work environment problem with the Vcron service account. Or, you are using the Vcron service account in combination with a Credential.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bv749
  •  bv749
  • Paid support Topic Starter
2013-05-13T15:53:18Z
I have still been unable to get the vbscript to successfully run using visual cron.

The Vcron service is running as the SYSTEM account.
The VBscript and the folder to create the file is on the local drive
The task is set to use no credentials.
All the script does is create a file.

That is as basic and vanilla as I can make it.

If I use the Windows Task Scheduler to run the script, it works.
Support
2013-05-13T16:32:41Z
Originally Posted by: bv749 

I have still been unable to get the vbscript to successfully run using visual cron.

The Vcron service is running as the SYSTEM account.
The VBscript and the folder to create the file is on the local drive
The task is set to use no credentials.
All the script does is create a file.

That is as basic and vanilla as I can make it.

If I use the Windows Task Scheduler to run the script, it works.



You said this before:

Quote:

I installed 6.2.2.

The re-install set the service back to run under the SYSTEM.

I ran the job and it worked.



What is different now?

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bv749
  •  bv749
  • Paid support Topic Starter
2013-05-13T17:08:17Z
You are correct. It did work once...once.

Then I changed the user under which the service was running and it did not work.

So I changed it back to run under the SYSTEM account and it no longer worked.

I re-installed 6.2.2 again, but it still would not work again.
Support
2013-05-13T19:11:34Z
Really hard to say but it seems to be related to permissions. I would try this on a vanilla machine.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top