Reputation: 41545
I have a PowerShell script like this:
$tfExe = path/to/tf.exe
& $tfExt ... do something
On my computer (and other PCs) if I run this script I get the .exe output in my PowerShell window.
When I run the script on another computer (with Windows 7 32-bit) it opens a cmd window, the output displayed there, and the window is immediately closed.
The issue occurs for each .exe tool, even in robocopy
.
Why does this happen and how can I change it?
Upvotes: 1
Views: 2062
Reputation: 200
I had a similar issue and figured out I had deleted the folder I was executing the commands from.
But this was not (I had deleted it outside of PowerShell - oops):
Navigating to another path solved the issue.
Upvotes: 1
Reputation: 41545
I had another issue with my PowerShell and the solution to that issue also solved this issue.
In my PATHEXT
environment variable I didn't have .exe
. When I added it, the issue solved and all the .exe tools ran smoothly and the output appears in the PowerShell window.
Upvotes: 2
Reputation: 1
You are starting an external exe, so it's working as intended. You could however try using cmd.exe /K - more info here https://ss64.com/nt/cmd.html
Upvotes: 0