Packaged PowerShell exe does not run

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 14 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
breitenbc
Posts: 4
Last visit: Fri Nov 20, 2009 12:01 am

Packaged PowerShell exe does not run

Post by breitenbc »

I am using PrimalScript 2007 Professional. I wrote a simple one line PowerShell(v1) script and packaged it using Script Packager. When I try to run the exe from a command prompt or PowerShell it does not run and displays this error: "Cannot run Script, error: The system cannot find the file specified." If I run the script from within PowerShell is runs without a problem.

While packaging the script I chose the following:

Execute with: Windows PowerShell
Unchecked Delete data files after script executes
Unpack script files and data files to Temporary folder (C:Temp)
Added the one PowerShell script file to Script Files

I have searched for the unpacked script file and it is not found. I am assuming that the exe does not even begin to execute. I have packaged many vbscripts in the past and they run without a problem.

Any assistance would be greatly appreciated.

Chris
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Packaged PowerShell exe does not run

Post by Alexander Riedel »

What exact build of PS2007 do you have? The exe runs, thats' what is displaying the error message. Can you check your temp folder if you have write access to that?
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
breitenbc
Posts: 4
Last visit: Fri Nov 20, 2009 12:01 am

Packaged PowerShell exe does not run

Post by breitenbc »

Alex,

The version is 4.5.581. I have write access to the temp folder. As a test, I also tried to change the folder to Same folder as the executable and again I do not see the unpackaged ps1 file and the same error is displayed.

Chris
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Packaged PowerShell exe does not run

Post by Alexander Riedel »

Can you please zip and email the the exe to support@sapien.com?
Please also include the packager ESP file.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
breitenbc
Posts: 4
Last visit: Fri Nov 20, 2009 12:01 am

Packaged PowerShell exe does not run

Post by breitenbc »

Alexander,

They have been sent.

Chris
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Packaged PowerShell exe does not run

Post by Alexander Riedel »

Ok, got it. It runs fine here:



So the exe is fine.
So that means it cannot write to the hard drive on your machine or not find PowerShell.exe.

I'll do some digging here and see what could be the cause.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
breitenbc
Posts: 4
Last visit: Fri Nov 20, 2009 12:01 am

Packaged PowerShell exe does not run

Post by breitenbc »

Alexander,

I was able to get it to work by adding the PowerShell location to my path. When you mentioned that it could not find PowerShell.exe, I tried entering powershell in Run... and it failed. Sorry this was so simple.

Chris
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Packaged PowerShell exe does not run

Post by Alexander Riedel »

No problem. I like simple :-)
I have to point out that in PrimalScript 2009 you can package the exe so it runs the script directly without temporary file. Just saying... ;-)
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 14 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.