+ Post New Thread
Results 1 to 4 of 4
Coding Thread, PSEXEC in Coding and Web Development; Hi there How can I use psexec to run batch file as admin Regards...
  1. #1

    Join Date
    Aug 2013
    Posts
    39
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    PSEXEC

    Hi there

    How can I use psexec to run batch file as admin


    Regards

  2. #2
    free780's Avatar
    Join Date
    Sep 2012
    Posts
    1,026
    Thank Post
    43
    Thanked 84 Times in 80 Posts
    Rep Power
    22
    Yes I cant remember the switch. You can also run as system which bypasses uac.

  3. #3

    Ephelyon's Avatar
    Join Date
    Aug 2008
    Location
    Cheshire, England
    Posts
    1,713
    Thank Post
    302
    Thanked 332 Times in 204 Posts
    Rep Power
    144
    I'm assuming this has to be on a remote computer as you could just use runas if it's on the local machine.

    The syntax is:

    psexec \\computername command

    Switches (that I've used anyway):

    -accepteula (I always sling this in just in case, so you don't get any annoying prompts)
    -d (don't wait for the remote process to terminate)
    -i (run the process interactively such that it appears on the screen)
    -s (run the process as LocalSystem)
    -x (run the process on the WinLogon desktop - requires additional customisation to work properly)

    You can combine switches like this:

    psexec \\computername -accepteula -dis command

    So this will run the command as LocalSystem, it can interact with the desktop and PsExec on your end won't wait for it to complete before terminating (useful if iterating through a list of computers, where the command is guaranteed to succeed, in e.g. a batch script).

  4. #4


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,163
    Thank Post
    234
    Thanked 2,744 Times in 2,022 Posts
    Rep Power
    801
    @engineer_z. Are you still trying to install Office?

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 4
    Last Post: 25th February 2009, 06:26 PM
  2. USING PSEXEC
    By Admiral208 in forum How do you do....it?
    Replies: 3
    Last Post: 22nd January 2009, 11:06 PM
  3. psexec - The greatest thing since buttered bread
    By stratisphere in forum General Chat
    Replies: 16
    Last Post: 20th December 2008, 04:03 PM
  4. psexec
    By chrbb in forum Windows
    Replies: 1
    Last Post: 21st April 2008, 03:05 PM
  5. Using PSexec To Install
    By Pear in forum Windows
    Replies: 18
    Last Post: 29th November 2005, 02:30 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
  •