jmair Posted March 25, 2009 Posted March 25, 2009 We're currently having some kind of DNS issue on our network and a local workaround is to ipconfig /registerdns 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. Thanks
SYNACK Posted March 25, 2009 Posted March 25, 2009 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
dwhyte85 Posted March 25, 2009 Posted March 25, 2009 Hello, 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
jmair Posted March 25, 2009 Author Posted March 25, 2009 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 Thanks! I'll give this a shot. I didnt know that admin commands could be run on startup.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now