+ Post New Thread
Results 1 to 4 of 4
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 ipconfig /registerdns I ...
  1. #1
    jmair's Avatar
    Join Date
    Aug 2007
    Posts
    291
    Thank Post
    65
    Thanked 9 Times in 9 Posts
    Rep Power
    16

    runas batchfile for login script?

    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

  2. #2

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,270
    Thank Post
    884
    Thanked 2,747 Times in 2,321 Posts
    Blog Entries
    11
    Rep Power
    785
    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).

  3. 2 Thanks to SYNACK:

    jmair (25th March 2009), techie211 (26th March 2009)

  4. #3
    dwhyte85's Avatar
    Join Date
    Mar 2009
    Location
    Berkshire
    Posts
    1,231
    Thank Post
    162
    Thanked 151 Times in 136 Posts
    Rep Power
    104
    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

  5. #4
    jmair's Avatar
    Join Date
    Aug 2007
    Posts
    291
    Thank Post
    65
    Thanked 9 Times in 9 Posts
    Rep Power
    16
    Quote Originally Posted by SYNACK View Post
    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.



SHARE:
+ Post New Thread

Similar Threads

  1. Login script - first attempt
    By itman in forum Windows
    Replies: 11
    Last Post: 24th October 2008, 05:08 PM
  2. Mac Login Script
    By gybe78 in forum Mac
    Replies: 2
    Last Post: 9th September 2008, 11:51 AM
  3. Script visibility after login
    By Blind in forum Scripts
    Replies: 5
    Last Post: 21st April 2008, 12:03 PM
  4. Vista + VB login script
    By dave.81 in forum Windows Vista
    Replies: 5
    Last Post: 17th February 2008, 05:29 PM
  5. Login script problem
    By SpuffMonkey in forum Windows
    Replies: 55
    Last Post: 4th February 2006, 10:27 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •