• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

Scheduled Task Error

B

bestebroer

Guest
I inserted a scheduled task at a domain with Plesk 8.1 to execute a .vbs file, nothing special, but it doesn't work. The event viewer returns the following 2 errors:

----------------------------------------
Event Type: Error
Event Source: runtask.exe
Event Category: None
Event ID: 1
Date: 1/31/2007
Time: 6:03:00 PM
User: N/A
Computer: WWW
Description:
Unable to create file 'C:\inetpub\vhosts\XXX.com\httpdocs\script\XXX.vbs': (5) Access is denied.
at Unable to execute event(runtask::start line 207) Execute file name: C:\Program Files\SWsoft\Plesk\admin\bin\runtask.exe
----------------------------------------

----------------------------------------
Event Type: Error
Event Source: Plesk Miscellaneous Service
Event Category: None
Event ID: 1
Date: 1/31/2007
Time: 6:03:00 PM
User: NT AUTHORITY\SYSTEM
Computer: WWW
Description:
Unable to create file 'C:\inetpub\vhosts\XXX.com\httpdocs\script\XXX.vbs': (5) Access is denied. at RaiseException in C:\WINDOWS\system32\kernel32.dll
at CxxThrowException in C:\WINDOWS\system32\MSVCR71.dll
at 4056A0 in C:\Program Files\SWsoft\Plesk\admin\bin\plesksrv.exe
at 425A1B in C:\Program Files\SWsoft\Plesk\admin\bin\plesksrv.exe
at 424E58 in C:\Program Files\SWsoft\Plesk\admin\bin\plesksrv.exe

Execute file name:
----------------------------------------

Anyone?
 
If you want to run .vbs file through the Plesk scheduler, do it like this:

Program to run: 'c:\windows\system32\cscript.exe'
Parameters: 'C:\inetpub\vhosts\XXX.com\httpdocs\script\XXX.vbs'
 
ok, but now i get the following error:

Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

CScript Error: Loading script "c:\Inetpub\vhosts\XXX.com\httpdocs\script\XXX.vbs" failed (Access is denied. ).
 
Can you please check the file permissions on c:\Inetpub\vhosts\XXX.com\httpdocs\script\XXX.vbs? Please make sure that the ftp user for domain XXX.com has at least read and execute NTFS file permissions on that file.
 
thanks for all your help. It was a permission problem, now i get an error again but i don't understand because the regional settings are 'English (united states) and SQL Server is English.

If i execute the .vbs file with the enter button it is working, but when Plesk is executing the file:

c:\Inetpub\vhosts\XXX.com\httpdocs\vbs\XXX.vbs(15, 1) Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

Do you know why Plesk is giving an error but executing by the 'enter' button it is not?

Thanks!
 
This error usually happens when you do one of the following things:

* attempt to insert a date in Access with ' delimiters;
* attempt to insert a date in SQL Server with # delimiters;
* attempt to insert a date in Access or SQL Server with no delimiters; or,
* attempt to insert a malformed date.

However, since your .vbs script works without any problems when it ran manually, I assume your code is correct.

Let's see a bit how Plesk runs scheduled tasks. Assume we have a domain called mydomain.com with the ftp user called 'login'. We set up a scheduled task in Plesk, 'mytask' to run 'c:\windows\system32\cscript.exe' with 'C:\Inetpub\vhosts\mytest.com\httpdocs\test.vbs' as a parameter (I hope you don't *** the quotes) and we don't set it to send any mail notifications when the task is run.

If check Control Panel >> Scheduled tasks on the server, you will see that one of those tasks with the weird names runs this command NT AUTHORITY\SYSTEM:
C:\WINDOWS\system32\cmd.exe /c ""C:\Plesk\admin\bin\runtask.exe" "--user=login" --defaultmail "--application=c:\windows\system32\cscript.exe" "--parameters=C:\Inetpub\vhosts\mytest.com\httpdocs\test.vbs""

As you can see, the task is actually ran through %plesk_bin%\runtask.exe and it's being ran by the domain's ftp user (which is called 'login' in our case).

I'm not sure if this is relevant to your problem, but it may help you troubleshoot this further.
 
One more question: Are you trying to pass any parameters to your .vbs script or is returning any results to stdout?
 
Originally posted by Bogdan
If you want to run .vbs file through the Plesk scheduler, do it like this:

Program to run: 'c:\windows\system32\cscript.exe'
Parameters: 'C:\inetpub\vhosts\XXX.com\httpdocs\script\XXX.vbs'
This is not required, result'll the same with both situation, at that independently with this error.
 
Originally posted by Bogdan

However, since your .vbs script works without any problems when it ran manually, I assume your code is correct.
One note, script's been run under 'Plesk Administrator' account by scheduler, also locale settings for these accounts may differ. For example you may login under 'Plesk Administrator' account and configure it locale settings. To get 'Plesk Administrator' password you can run Plesk command line utility 'papswd.exe --get'.
 
Back
Top