{"id":2383,"date":"2010-08-16T13:23:51","date_gmt":"2010-08-16T21:23:51","guid":{"rendered":"http:\/\/www.sapien.com\/blog\/?p=2383"},"modified":"2010-08-16T13:24:00","modified_gmt":"2010-08-16T21:24:00","slug":"moving-to-64-bit-running-powershell-files-in-64-bit-from-primalscript-2009","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2010\/08\/16\/moving-to-64-bit-running-powershell-files-in-64-bit-from-primalscript-2009\/","title":{"rendered":"Moving to 64 bit: Running PowerShell files in 64 bit from PrimalScript 2009"},"content":{"rendered":"<p>Last time we looked at running VBScript files in 64 bit from within PrimalScript 2009. As you may recall, the only thing required was to provide a path to the 64 bit CScript.exe or WScript.exe and substituting &#8220;sysnative&#8221; for &#8220;system32&#8221;. The rest was all automatic.<\/p>\n<p>As I mentioned last time, PowerShell requires some extra work. PrimalScript redirects stdin, stdout and stderr when capturing the output of a process and PowerShell.exe does not react well to that. This has been a PowerShell problem since V1 and wasn&#8217;t fixed with V2. Basically the PowerShell process will just hang and do nothing when you redirect stdin. I am assuming that if PowerShell sees a redirected stdin stream it just awaits commands from there and ignores anything else.<\/p>\n<p>I have created a little helper app that will take care of that:<\/p>\n<p><a title=\"ftp:\/\/ftp.sapien.com\/exec64.zip\" href=\"ftp:\/\/ftp.sapien.com\/exec64.zip\">ftp:\/\/ftp.sapien.com\/exec64.zip<\/a><\/p>\n<p>Download and extract the executable to your PrimalScript 2009 installation folder.<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2010\/08\/Posh64bit.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px\" height=\"450\" alt=\"Posh64bit\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2010\/08\/Posh64bit_thumb.png\" width=\"644\" border=\"0\"><\/a><\/p>\n<p>Right click anywhere in the tools browser and select \u201cCustomize\u2026\u201d and add a new tool in a group of your choice.<\/p>\n<p>Name the new tool &#8220;PowerShell (64 bit) or whatever your like and set the properties as follows:<\/p>\n<p>Command line: Exec64<\/p>\n<p>Arguments: C:\\Windows\\System32\\WindowsPowerShell\\V1.0\\powershell.exe -NonInteractive \\&#8221;&amp;&#8217;$File$&#8217;\\&#8221;<\/p>\n<p>Initial Directory: $FileDir$<\/p>\n<p>Check &#8220;Capture Output&#8221;<\/p>\n<p>In order to run the current script in 64 bit mode you only have to click on the icon.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last time we looked at running VBScript files in 64 bit from within PrimalScript 2009. As you may recall, the only thing required was to provide a path to the 64 bit CScript.exe or WScript.exe and substituting &#8220;sysnative&#8221; for &#8220;system32&#8221;. The rest was all automatic. As I mentioned last time, PowerShell requires some extra work. [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[283,410,21,25],"tags":[525,28,37],"class_list":["post-2383","post","type-post","status-publish","format-standard","hentry","category-howto","category-primalscript-software-news","category-software-news","category-windows-powershell","tag-64-bit","tag-powershell","tag-primalscript"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/2383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=2383"}],"version-history":[{"count":2,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/2383\/revisions"}],"predecessor-version":[{"id":2385,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/2383\/revisions\/2385"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=2383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=2383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=2383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}