John Baughman
2015-04-18 22:30:09 UTC
I have a PowerShell script that sends a request to QuickBooks which I am trying to run from 4D using Launch External Process. The system is 64 bit but QuckBooks is 32 bit so I have to use the 32 bit version of PowerShell.
Here is what I am passing to LRP which does not work...
$FilePath:="%SystemRoot%\\sysWoW64\\WindowsPowerShell\\v1.0\\powershell.exe &\""C:\\CC_FolioPro 2013\\Resources\\PS\\QB_TestConnection.ps1\"”
SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
LAUNCH EXTERNAL PROCESS($FilePath)
Basically it is supposed to run the powershell script in the QB_TestConnection.ps1 file using the 32 bit version of PowerShell. I have left out a bunch of other environmental variables being set for clarity.
If, however, I comment out _4D_OPTION_HIDE_CONSOLE or set it to false and just pass the PowerShell part with out the path to the script file like this
$FilePath:="%SystemRoot%\\sysWoW64\\WindowsPowerShell\\v1.0\\powershell.exe"
// SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE”;"false")
SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
LAUNCH EXTERNAL PROCESS($FilePath)
Then when the PowerShell Command Prompt opens, manually execute the script file like this...
&"C:\CC_FolioPro 2013\Resources\PS\QB_TestConnection.ps1”
It works perfectly.
Does anyone know what I might be doing wrong here. I must not be passing the script file path properly.
Thanks,
John
John Baughman
Kailua, Hawaii
(808) 262-0328
***@hawaii.rr.com
**********************************************************************
See how easy it is to extend your 4D solutions to Web and mobile. New opportunities await you with 4D v14!
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
**********************************************************************
Here is what I am passing to LRP which does not work...
$FilePath:="%SystemRoot%\\sysWoW64\\WindowsPowerShell\\v1.0\\powershell.exe &\""C:\\CC_FolioPro 2013\\Resources\\PS\\QB_TestConnection.ps1\"”
SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
LAUNCH EXTERNAL PROCESS($FilePath)
Basically it is supposed to run the powershell script in the QB_TestConnection.ps1 file using the 32 bit version of PowerShell. I have left out a bunch of other environmental variables being set for clarity.
If, however, I comment out _4D_OPTION_HIDE_CONSOLE or set it to false and just pass the PowerShell part with out the path to the script file like this
$FilePath:="%SystemRoot%\\sysWoW64\\WindowsPowerShell\\v1.0\\powershell.exe"
// SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE”;"false")
SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
LAUNCH EXTERNAL PROCESS($FilePath)
Then when the PowerShell Command Prompt opens, manually execute the script file like this...
&"C:\CC_FolioPro 2013\Resources\PS\QB_TestConnection.ps1”
It works perfectly.
Does anyone know what I might be doing wrong here. I must not be passing the script file path properly.
Thanks,
John
John Baughman
Kailua, Hawaii
(808) 262-0328
***@hawaii.rr.com
**********************************************************************
See how easy it is to extend your 4D solutions to Web and mobile. New opportunities await you with 4D v14!
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
**********************************************************************