[576] in winnt

home help back first fref pref prev next nref lref last post

NT Scripting

daemon@ATHENA.MIT.EDU (Chris Meehan)
Fri Oct 6 12:52:01 2000

Message-Id: <200010061651.MAA02231@melbourne-city-street.MIT.EDU>
Date: Fri, 06 Oct 2000 12:51:47 -0400
To: ntpartners@mit.edu
From: Chris Meehan <cmeehan@MIT.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"


Hi All,

Here is what I have learned about the Soon command.  Jamie thanks for the
lead.

The line I want to execute is   SOON 60 cmd /c c:\download\sysinfo.bat
One minute later nothing happens.
SYSINFO.BAT executes normally when run from a command prompt.

Run this command SOON 60 /interactive cmd.exe /k
It will open a command shell.
Type SET to see the environment variables.
If you can get your script to work here it will work with the SOON command.

Using the SOON command with less than a 60 second delay will sometimes
cause the task to be scheduled for the next day. 

I have included the article that helped below

This fixed the scheduling problem but has introduced a path problem.  
Does anyone know how to tell which directory the script is executing from,
from within the script?

Later
Chris

PSS ID Number: Q142040
Article last modified on 01-17-2000
  
SUMMARY
=======
 
One way to troubleshoot a batch job that is scheduled to run using the AT
command is to type the following at the MS-DOS command prompt:
 
" AT <xx.xx> /interactive cmd.exe /k " (without the quotation marks)
 
   where <xx.xx> is the time in hours and minutes.
 
Using the Windows NT Resource Kit utility Soon.exe, this command can be
simplified even further to run within the next 5 seconds automatically:
 
   SOON /interactive cmd.exe /k
 
Both of these commands open the MS-DOS command prompt at a scheduled time and
allow you to manually run the batch job.
 
If an MS-DOS command prompt does not open, then launch the Control Panel
Services
applet and check to see if the Schedule service is started. Click the Startup
button and make certain that the System account is selected; only the system
account can interact with the desktop. Network connections made under the
System
account use a null session for credentials, so it may be necessary to supply a
user name and password for commands such as NET USE.
 
Before running your batch job, type the command "SET" in order to
understand the
environment that the command scheduler is running under; all environmental
variables including the user name will be listed.
 
MORE INFORMATION
================
 
The AT command syntax above allows you to troubleshoot situations where a
batch
job runs successfully when it is executed from the command line, but it
does not
work when you execute it using the AT command.
 
In addition to troubleshooting the batch job, do the following:
 
1. Include the ECHO and PAUSE commands in your batch file so that you can
narrow
  down the cause of the problem.
 
2. When you use the AT command, make sure you are using the correct schedule
  service account. In the Control Panel Services applet, verify the "Log On
As"
  account for the Schedule service. This account determines whether the task
  scheduled to run has access to the network or the local computer.
 
3. Determine if the task requires interaction with the desktop. If so, use
  LocalSystem for the Schedule service. However, this means that network
  connectivity is not available unless you type the following at the command
  line: "NET USE \\<server name>\<share name>
  /U:<domain>\<user name> <password>" (without the quotation
  marks)


************************************************************
Chris Meehan                     
400 Main St. E19-504             Phone    (617) 253-7619
Cambridge MA 02139-4307          Fax      (617) 258-0650
************************************************************


home help back first fref pref prev next nref lref last post