Re: problems scheduling a .wsf file - can not find script file
From: Michael Harris \(MVP\) ("Michael)
Date: 02/27/05
- Next message: Michael Harris \(MVP\): "FYI: Scripting and Windows AntiSpyware (Beta)"
- Previous message: Shan McArthur: "problems scheduling a .wsf file - can not find script file"
- In reply to: Shan McArthur: "problems scheduling a .wsf file - can not find script file"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 27 Feb 2005 14:33:20 -0800
Shan McArthur wrote:
> Hello,
>
> I am running Windows 2003 and am having a very difficult time getting
> a .wsf script file scheduled with the operating system's scheduler.
> The program runs fine from the command line, and it even runs fine as
> a scheduled task as long as I am logged into the server. However, if
> I am not logged into the server, the script file fails to run and
> shows a "can not find script file" error.
>
> I have reduced the problem to the following files:
> launch.cmd:
> C:\WINDOWS\system32\cscript.exe C:\Operations\SQL\test.wsf
> >> C:\Operations\SQL\restore.log
You need to run via the command shell to get redirection. You also do not
need the full path the cscript.exe - Windows will find it on its own since
it is in the system32 folder.
%comspec% /C cscript.exe C:\Operations\SQL\test.wsf
>>C:\Operations\SQL\restore.log
>
> test.wsf:
> <job>
> <script language="JScript">
> var sErrors = "";
> </script>
> </job>
>
> The following is dumped into the restore.log file:
> Microsoft (R) Windows Script Host Version 5.6
> Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
>
> Input Error: Can not find script file "C:\Operations\SQL\test.wsf".
>
> If I set the user credentials to another admin account, the job never
> successfully completes.
> If I set the user credentials to my account and remain logged on, the
> job starts in a window and successfully completes.
> If I am not logged on, the job never successfully completes, despite
> it having completed successfully when I am logged on.
>
> Any ideas? This is REALLY spooky.
>
> Thanks,
> Shan McArthur
-- Michael Harris Microsoft MVP Scripting http://maps.google.com/maps?q=Sammamish%20WA%20US
- Next message: Michael Harris \(MVP\): "FYI: Scripting and Windows AntiSpyware (Beta)"
- Previous message: Shan McArthur: "problems scheduling a .wsf file - can not find script file"
- In reply to: Shan McArthur: "problems scheduling a .wsf file - can not find script file"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|