Menu

#1057 cannot execute C:/WINDOWS/sytem32/shutdown.exe on windows

Win32
closed-invalid
5
2007-11-09
2007-11-08
G
No

I cannot issue

staf "machine name" process start stderrtostdout returnstdout command C:/WINDOWS/sytem32/shutdown.exe

or

staf "machine name" process start stderrtostdout returnstdout command shutdown

on a windows host.

Discussion

  • David Michael Bender

    Logged In: YES
    user_id=285133
    Originator: NO

    You need to specify an option to the shutdown.exe program. If I run a command similar to yours, the system does not shutdown, but if you add the "WAIT" option, you will see that the stdout/stderr shows you the following:

    $ STAF test-machine PROCESS START STDERRTOSTDOUT RETURNSTDOUT COMMAND C:/WINDOWS/system32/shutdown.exe WAIT
    Response
    --------
    {
    Return Code: 0
    Key : <None>
    Files : [
    {
    Return Code: 0
    Data : Usage: E:/WINDOWS/system32/shutdown.exe [-i | -l | -s | -r |
    -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy]

    No args Display this message (same as -?)
    -i Display GUI interface, must be the first option
    -l Log off (cannot be used with -m option)
    -s Shutdown the computer
    -r Shutdown and restart the computer
    -a Abort a system shutdown
    -m \\computername Remote computer to shutdown/restart/abort
    -t xx Set timeout for shutdown to xx seconds
    -c "comment" Shutdown comment (maximum of 127 characters)
    -f Forces running applications to close without war
    ning
    -d [u][p]:xx:yy The reason code for the shutdown
    u is the user code
    p is a planned shutdown code
    xx is the major reason code (positive integer le
    ss than 256)
    yy is the minor reason code (positive integer le
    ss than 65536)

    }
    ]
    }

    So, if I add "PARMS -s" to the PROCESS START request, the system will shutdown (or add "PARMS -r" to shutdown and restart the machine):

    $ STAF test-machine PROCESS START STDERRTOSTDOUT RETURNSTDOUT COMMAND E:/WINDOWS/system32/shutdown.exe PARMS -s
    Response
    --------
    37

     
  • David Michael Bender

    • assigned_to: nobody --> dave2268
     
  • G

    G - 2007-11-09
    • status: open --> open-invalid
     
  • G

    G - 2007-11-09

    Logged In: YES
    user_id=1143083
    Originator: YES

    Sorry this is a group policy issue. I just had to give certain groups of users the ability to shutdown the system.

     
  • David Michael Bender

    • status: open-invalid --> closed-invalid
     

Log in to post a comment.