WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

NT Native Commands with WinBatch

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

More on the NT Scheduler

Keywords:    NT Scheduler

Question:

Is there any way to launch a compiled WinBatch script in any of the following two scenarios:
  1. From the NT Scheduler with no user logged in to the NT system.

  2. From the NT scheduler with the workstation "locked."
Or, is there a way to launch a compiled WinBatch from the NT Scheduler which will log in a user as it's first action?

I would appreciate any suggestions in this regard. We need to perform maintenance functions after hours with workstation security in place.

Answer:

You can set the schedule service to login as a particular person. At the workstation (or service) go to the services control panel. Find the schedule service. click the startup button. There is a section at the bottom that allows you to specify a user and password. If the user is in a different domain than the one the machine put "domain\user" as the user id. If the users password changes you will have to adjust the service on each machine to the new password.

You must have administrative privileges on the computer to do this. [the user name you put in does not have to have administrative privileges, it will be granted the right to login as a service]. The schedule service will run with whatever privileges you assign that user.


>1. From the NT Scheduler with
>no user logged in to the NT
>system.

Yes. However there are various considerations.

a) It runs without much in the way of useful environment 
variables (Path, Temp, Etc) and/or defaults
(printers servers security) so everything has 
to be hard coded.

b) Other servers look askance at any network requests 
issued by the program and only allow connects
when security on the remote servers has pretty much 
been nullified. Basically the WinBatch process cannot
impersonate any user to get any degree of security 
privledges.


>
>2. From the NT scheduler with
>the workstation "locked."

I have vague recollections about this one. I'm not 
sure if it can launch the program. Either it works, or it
waits till the workstation is unlocked. I do recall that 
if the script puts up anykind of window (e.g. Display)
then the process is suspeced until the lock is removed.



>
>Or, is there a way to launch a
>compiled WinBatch from the NT
>Scheduler which will log in a
>user as it's first action?

I don't think so.



>
>I would appreciate any
>suggestions in this regard.
>We need to perform maintenance
>functions after hours with
>workstation security in place.

A few more clues about what you need to do might be 
helpful. You could also write a few scripts, test
them in normal mode and then try them scheduled. It 
is helpful to keep a running log file to help debugging.
e.g.

msg="Initializing"
gosub loglog
;do stuff
;more stuff;
msg="Starting process 1"
gosub loglog
; do stuff
msg="Starting process 2"
;do smore stuff
msg="Task complete"
gosub loglog
exit

;LOGLOG subroutine
xyz=FileOpen("C:\loglog.txt","APPEND")
FileWrite(xyz,loglog)
FileCLose(xyz)
return
By running the log file you can isolate problems, write info to the file etc etc.
Article ID:   W13651
Filename:   More on the NT Scheduler.txt
File Created: 2001:01:29:15:22:34
Last Updated: 2001:01:29:15:22:34