9 replies
by tprinzo
by rswihart
Versions of NT prior to Windows 2000 only permit setting the user Id context within the startup parameters for starting the service. Not command line changeable.
For windows 2000 you can set the user ID as part of setting up the task. Task Scheduler is only a GUI interface. Microsoft thinks users are too stupid or too lazy to use a command line. Therefore changing user context is not changable within a script at this time.
ralph
by rswihart
by joseph moore
You can't set the AT command to run under another system context, not unless you have the updated Task Scheduler that IE4 (or was it IE5) shipped out with.
But, you can fake AT out.
What you can do is instead of setting your AT command line with the full app you want to run (for example, instead of putting in: AT time 01:00 "notepad c:\temp\myfile.txt"
to sechedule Notepad to run this text file at 1AM) you can have AT run a BAT file. In the BAT file, use the RUNAS command to select the user account to run the program under.
So, in this example, have a file called MYFILE.BAT contain the following:
RUNAS /user:domain\administrator "notepad "c:\temp\myfile.txt""
Then set up the AT command like this:
AT time 01:00 "c:\temp\myfile.bat"
AT will run the BAT, and the BAT will say to run Notepad under the Administrator account.
Now, when you do this, it will prompt for the password for admin. But, if you are there to type it in (or if a night operator is there with the password to do the typing for you) then all is well. There probably is a way to pass the password in the BAT file, assigning it to a variable and passing the variable. But this should give you an idea on something to try.
Hope this helps.
by rswihart
by tejota
by rswihart
by rswihart
This discussion is closed to new replies.
Trending Windows Forum posts
Sort by Trending