BatchPatch Forums Home › Forums › BatchPatch Support Forum › Elevated Command Prompt Issues
- This topic has 6 replies, 2 voices, and was last updated 8 years, 9 months ago by doug.
-
AuthorPosts
-
February 11, 2016 at 8:17 pm #8656Matthew DartezParticipant
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.
February 11, 2016 at 8:44 pm #9747dougModeratorHi 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
February 11, 2016 at 9:05 pm #9748Matthew DartezParticipantInteresting. 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
February 11, 2016 at 9:06 pm #9749Matthew DartezParticipant^ Install at the end is the input. “agent.bat install”
February 11, 2016 at 9:15 pm #9750dougModeratorI’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.
-Doug
February 11, 2016 at 9:22 pm #9751Matthew DartezParticipantIt’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?
February 11, 2016 at 9:25 pm #9752dougModeratorPut 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
-
AuthorPosts
- You must be logged in to reply to this topic.