{"id":1906,"date":"2013-02-16T08:41:57","date_gmt":"2013-02-16T13:41:57","guid":{"rendered":"http:\/\/antipaucity.com\/?p=1906"},"modified":"2013-02-16T08:41:57","modified_gmt":"2013-02-16T13:41:57","slug":"call","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=1906","title":{"rendered":"call"},"content":{"rendered":"<p>I learned about the <code>call<\/code> command in Windows recently.<\/p>\n<p>Some context &#8211; was trying to run a command via <a href=\"http:\/\/antipaucity.com\/tag\/hpsa\/#.UR6BEqXkv00\">HPSA<\/a> at a customer, but kept getting an error that the program was not a recognized internal or external command.<\/p>\n<p>Very frustrating.<\/p>\n<p>Then one of the guys I worked with suggested adding a &#8220;call&#8221; to the front of my script. That worked like a champ. Here&#8217;s why.<\/p>\n<p>When the HPSA Agent on a Managed Server receives a script to run from the Core, it runs it in a headless terminal session. This means that while environment variables (eg <code>%ProgramFiles%<\/code>) expand properly, if the first part of the command is\u00a0<strong>NOT<\/strong> a built-in from cmd.exe, it won&#8217;t execute. Unlike *nix which is\u00a0designed\u00a0to run most things headless, Windows never was (and isn&#8217;t still as of Win2k8R2).<\/p>\n<p>The built-in command &#8216;<code>call<\/code>&#8216; forks the next command to a full session (albeit still headless), and enables <code>cmd.exe<\/code> to run it properly.<\/p>\n<p>Now you know.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I learned about the call command in Windows recently. Some context &#8211; was trying to run a command via HPSA at a customer, but kept getting an error that the program was not a recognized internal or external command. Very frustrating. Then one of the guys I worked with suggested adding a &#8220;call&#8221; to the &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=1906\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">call<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[19,23,41,48],"tags":[394,664,852],"keyring_services":[],"class_list":["post-1906","post","type-post","status-publish","format-standard","hentry","category-hmmm","category-insights","category-technical","category-work","tag-hpsa","tag-scripting","tag-windows"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/1906","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1906"}],"version-history":[{"count":0,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/1906\/revisions"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1906"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=1906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}