Elevated Command Prompt Issues

BatchPatch Forums Home Forums BatchPatch Support Forum Elevated Command Prompt Issues

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #8656
    Matthew Dartez
    Participant

    I am trying to figure out how I can execute the remote cmd.exe as an elevated command prompt via BatchPatch – the .bat script i am trying to execute remotely requires this.

    If you have any ideas how to do it or have a work around that would be awesome.

    #9747
    doug
    Moderator

    Hi Matt – BatchPatch always executes remote commands in the SYSTEM account, which has the highest possible privileges. You should not need to add anything extra. However, if you want, PsExec also supports the -h parameter, which is supposed to elevate when possible. In BatchPatch Remote Commands 1 and 2 support PsExec switches, so you could include -h before any subsequent command. However, like I said, this really should not be necessary. I suspect it would not do anything anyway since the SYSTEM account already has complete system access with no UAC prompts.

    -Doug

    #9748
    Matthew Dartez
    Participant

    Interesting. I am running .bat script remote on a few servers. I set it up as executing a remote command/process with logged output:

    cmd.exe “C:TEMPbinagent.bat” install

    #9749
    Matthew Dartez
    Participant

    ^ Install at the end is the input. “agent.bat install”

    #9750
    doug
    Moderator

    I’m not sure if you’re saying that it’s not working, or if it’s not working what the error is or isn’t…

    However, my recommendation would be to just use the Deployment feature to deploy the .bat. ‘Actions > Deploy’ instead of ‘Actions > Remote Command.’ Then you don’t need to figure anything out. Just select your .bat, add the “install” parameter, and then let BatchPatch handle copying it to the targets and executing it with the proper syntax.

    DeploySampleScreen20160211

    -Doug

    #9751
    Matthew Dartez
    Participant

    It’s not working sorry from earlier!

    The batch file looks for a .properties file to get it’s setup data (This program is a monitoring agent) so how would you deploy the batch file if it’s looking for all the items in a folder that it references?

    #9752
    doug
    Moderator

    Put the .bat plus all other files in a folder. Make sure the .bat file is using relative file references, not absolute paths, so that when the .bat is executed, it finds the other files in the same dir that it is executed from. Then in the Deployment window choose the option to “Copy entire directory contents.” There is an tutorial of this type of script deployment with multiple referenced files here: Install Multiple .MSU Files with a script

    -Doug

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.