Windows Server 2000/2003 Thread, runas batchfile for login script? in Technical; We're currently having some kind of DNS issue on our network and a local workaround is to
25th March 2009, 02:40 PM #1
runas batchfile for login script?
We're currently having some kind of DNS issue on our network and a local workaround is to
I would like to (untill the issue is resolved) add this to the login script, but i requires admin rights.
Is there a way that I can do this in the login script with a runas? Unless somebody knows another way around this.
25th March 2009, 03:03 PM #2
You could put it in the machine startup script instead then you would not need to elevate the command.
Run a script on Windows startup without a user logged on - Stack Overflow
Windows 2000 and above offer a "Startup Scripts" item in the policy editor:
Computer Settings -> Windows Settings -> Scripts (Startup/Shutdown)
There's an equivalent logon script area (once a user has logged on) in the User configuration bit.
The computer startup scripts run in the computer context, i.e. LocalSystem, as you noted, so they often can't access network drives and so on.
A startup script is a quick and easy way of getting a process running when the machine boots. The computer startup process will be affected by the time it takes to run the program, though, so you might want to ensure you call it with the START command from a batch file, or specifying not to wait for the executable to complete from whatever script language you use. (the key point there is: run the script asynchronously unless it's critical, or doesn't need to be run asynchronously cos it will always take no time at all. Long boots = unhappy users).
2 Thanks to SYNACK:
jmair (25th March 2009), techie211 (26th March 2009)
25th March 2009, 03:05 PM #3
Not sure the RUNAS command could be used as simply, I don't think it would allow you to put in a password IIRC.
VBS would be a better option as it has the option to impersonate
25th March 2009, 08:14 PM #4
Thanks! I'll give this a shot. I didnt know that admin commands could be run on startup.
Originally Posted by SYNACK
By itman in forum Windows
Last Post: 24th October 2008, 04:08 PM
Last Post: 9th September 2008, 10:51 AM
By Blind in forum Scripts
Last Post: 21st April 2008, 11:03 AM
By dave.81 in forum Windows Vista
Last Post: 17th February 2008, 04:29 PM
By SpuffMonkey in forum Windows
Last Post: 4th February 2006, 09:27 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)