Re: problems scheduling a .wsf file - can not find script file

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Michael Harris \(MVP\) ("Michael)
Date: 02/27/05


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 


Relevant Pages

  • problems scheduling a .wsf file - can not find script file
    ... I am running Windows 2003 and am having a very difficult time getting a .wsf ... script file scheduled with the operating system's scheduler. ... If I set the user credentials to another admin account, ...
    (microsoft.public.windows.server.scripting)
  • Re: Christina Aguilera caught back stage NUDE - Yerrrr. VIRUS ALERTAGAIN. SEE THE OTHERS!!!!!
    ... > ADE Microsoft Access Project Extension ... > CMD Windows NT Command Script ... > PIF Shortcut to MS-DOS Program ... > VBE VBScript Encoded Script File ...
    (comp.lang.java)
  • RE: [SLE] TCP / IP Printing
    ... TCP / IP Printing ... You could possibly call the script file a driver? ... >> I use the ICE.TCP printing solution for speed. ... From linux, windows, or any IPP client. ...
    (SuSE)
  • Re: execute and wait
    ... > I have a program that can be run by clicking a script file in Windows ... > Explorer because of its file association with the program. ...
    (borland.public.delphi.nativeapi)
  • Re: setting logon time limits
    ... > directly into the Task Scheduler wizard. ... > notepad and save as a .BAT or CMD file. ... >> Yes Sir Bryce that could indeed be what I want but I have one more ... is this a script file that I need to write in say ...
    (microsoft.public.windowsxp.security_admin)