{"id":5198,"date":"2020-06-24T18:28:33","date_gmt":"2020-06-24T22:28:33","guid":{"rendered":"https:\/\/batchpatch.com\/?p=5198"},"modified":"2020-06-24T18:30:46","modified_gmt":"2020-06-24T22:30:46","slug":"batchpatch-remote-command-execution-options","status":"publish","type":"post","link":"https:\/\/batchpatch.com\/batchpatch-remote-command-execution-options","title":{"rendered":"BatchPatch Remote Command Execution Options"},"content":{"rendered":"<p>BatchPatch has a number of commands and actions that are built-in and come with the software&#8230;  Windows update commands, reboot and shutdown commands, wake on LAN, commands to get information from target computers about disk space usage, uptime, logged-on users, file version information, registry values, commands to review\/modify services and processes, and a lot more.  But what if you want to execute a command that isn&#8217;t already built-in?  Obviously not all commands are going to be useful for all users, and we can&#8217;t include every command that ever existed in the history of all commands \ud83d\ude42  Inevitably you might find yourself wanting to hard-code some of your own commands into BatchPatch to execute on remote systems.<\/p>\n<p>BatchPatch provides a few different places and ways to store and execute your own commands.  <\/p>\n<p>1. Under &#8216;<em>Actions > Get information > Create\/modify user-defined commands<\/em>&#8216; BatchPatch provides and interface for you to add your own commands.  Once a command is added in this interface, the command will appear in the BatchPatch menu under &#8216;<em>Actions > Get information > Execute user-defined commands<\/em>&#8216;<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/06\/2020-06-24-17_37_45-Get-Information-User-Defined-Commands.png\"><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/06\/2020-06-24-17_37_45-Get-Information-User-Defined-Commands.png\" alt=\"\" width=\"557\" height=\"450\" class=\"aligncenter size-full wp-image-5199\" srcset=\"https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-17_37_45-Get-Information-User-Defined-Commands.png 557w, https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-17_37_45-Get-Information-User-Defined-Commands-300x242.png 300w\" sizes=\"auto, (max-width: 557px) 100vw, 557px\" \/><\/a><\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/06\/2020-06-24-17_39_59-.png\"><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/06\/2020-06-24-17_39_59--1024x687.png\" alt=\"\" width=\"540\" height=\"362\" class=\"aligncenter size-large wp-image-5200\" srcset=\"https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-17_39_59--1024x687.png 1024w, https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-17_39_59--300x201.png 300w, https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-17_39_59--768x515.png 768w, https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-17_39_59-.png 1316w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/a><\/p>\n<p>2.  Under &#8216;<em>Actions > Execute remote process\/command<\/em>&#8216; there are several options.  Remote command 1, 2, 3, 4 can be created and will be stored in the current grid and visible in the row under which they are created.  Commands 1 and 2 do not attempt to capture output and will only report exit codes upon execution.  Commands 3 and 4 attempt to capture output, so that you can display the output in the grid upon execution.  Under the hood the logged-output commands (3\/4) have to be executed differently from the standard commands (1\/2), and in some cases this difference can cause failure, which is why we separate these completely.  If a command fails to execute under 3\/4 it might be successful under 1\/2.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/06\/2020-06-24-17_50_43-.png\"><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/06\/2020-06-24-17_50_43-.png\" alt=\"\" width=\"803\" height=\"749\" class=\"aligncenter size-full wp-image-5201\" srcset=\"https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-17_50_43-.png 803w, https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-17_50_43--300x280.png 300w, https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-17_50_43--768x716.png 768w\" sizes=\"auto, (max-width: 803px) 100vw, 803px\" \/><\/a><\/p>\n<p>Additionally under &#8216;<em>Actions > Execute remote process\/command<\/em>&#8216; we have &#8216;<em>Create\/modify remote commands<\/em>&#8216; and &#8216;<em>Create modify remote commands (logged output)<\/em>&#8216; where you can create commands that won&#8217;t be tied to a particular grid and will instead be saved globally for all BatchPatch instances that you launch.  Commands created under these interfaces appear hard-coded in the BatchPatch menu under &#8216;<em>Actions > Execute remote process\/command<\/em>&#8216; as &#8216;<em>Execute saved remote commands<\/em>&#8216; and &#8216;<em>Execute saved remote commands (logged output)<\/em>&#8216;, respectively.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/06\/2020-06-24-17_54_30-.png\"><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/06\/2020-06-24-17_54_30--1024x666.png\" alt=\"\" width=\"540\" height=\"351\" class=\"aligncenter size-large wp-image-5202\" srcset=\"https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-17_54_30--1024x666.png 1024w, https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-17_54_30--300x195.png 300w, https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-17_54_30--768x499.png 768w, https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-17_54_30-.png 1410w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/a><\/p>\n<p>More details on hard-coding custom commands into BatchPatch can be found here: <a href=\"\/how-to-hard-code-your-own-custom-commands-in-the-batchpatch-actions-menu\" title=\"How to Hard-Code Your Own Custom Commands in the BatchPatch Actions Menu\">How to Hard-Code Your Own Custom Commands in the BatchPatch Actions Menu<\/a><\/p>\n<p><!--LINE SEPARATOR--><\/p>\n<hr style=\"border-top: 1px solid white; border-bottom: 1px solid gray; width:100%;\"<\/hr>\n<p><!--LINE SEPARATOR--><\/p>\n<p>Once a command has been hard-coded into BatchPatch, not only is it available for direct execution on target computers, but now it can also be included in job queues or be executed by the Task Scheduler.  You can see in the screenshot below that the Job Queue window shows all of my previously created hard-coded commands, deployments, copy jobs etc.  I can add any of them to a job queue for automation.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/06\/2020-06-24-18_04_32-.png\"><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/06\/2020-06-24-18_04_32-.png\" alt=\"\" width=\"1010\" height=\"493\" class=\"aligncenter size-full wp-image-5203\" srcset=\"https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-18_04_32-.png 1010w, https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-18_04_32--300x146.png 300w, https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-18_04_32--768x375.png 768w\" sizes=\"auto, (max-width: 1010px) 100vw, 1010px\" \/><\/a><\/p>\n<p>Additionally, all job queues will appear along with all hard-coded commands, deployments, copy jobs etc in the Task Scheduler so that you can schedule any job queue or command that you have previously created.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2020\/06\/2020-06-24-18_02_14-.png\"><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/06\/2020-06-24-18_02_14-.png\" alt=\"\" width=\"649\" height=\"488\" class=\"aligncenter size-full wp-image-5204\" srcset=\"https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-18_02_14-.png 649w, https:\/\/batchpatch.com\/wp-content\/uploads\/2020\/06\/2020-06-24-18_02_14--300x226.png 300w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>BatchPatch has a number of commands and actions that are built-in and come with the software&#8230; Windows update commands, reboot and shutdown commands, wake on LAN, commands to get information from target computers about disk space usage, uptime, logged-on users, file version information, registry values, commands to review\/modify services and processes, and a lot more. [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1,17],"tags":[217,227,420],"class_list":["post-5198","post","type-post","status-publish","format-standard","hentry","category-blog","category-general","tag-remote-commands","tag-remote-execution","tag-remote-scripts"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/batchpatch.com\/wp-json\/wp\/v2\/posts\/5198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/batchpatch.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/batchpatch.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/batchpatch.com\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/batchpatch.com\/wp-json\/wp\/v2\/comments?post=5198"}],"version-history":[{"count":1,"href":"https:\/\/batchpatch.com\/wp-json\/wp\/v2\/posts\/5198\/revisions"}],"predecessor-version":[{"id":5205,"href":"https:\/\/batchpatch.com\/wp-json\/wp\/v2\/posts\/5198\/revisions\/5205"}],"wp:attachment":[{"href":"https:\/\/batchpatch.com\/wp-json\/wp\/v2\/media?parent=5198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/batchpatch.com\/wp-json\/wp\/v2\/categories?post=5198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/batchpatch.com\/wp-json\/wp\/v2\/tags?post=5198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}