A similar question was asked several times on SO, and usually the answer is one of:
cmd
and then the commandscmd
passing /c
and a few other things that I've already tried. But my problem is: I have a specific program (cntkpy34.bat
) that refuses to run on PowerShell. That is, with any of solutions like above I still get "Please execute this script from inside a regular Windows command prompt."
So what I really want is to invoke a new cmd.exe
window and run the commands on it. How can this be achieved in a PowerShell script?
EDIT: inspecting the batch-file, this is how it verifies the shell:
if /I "%CMDCMDLINE%" neq ""%COMSPEC%" " (
echo.
echo Please execute this script from inside a regular Windows command prompt.
echo.
exit /b 0
)
Even starting a new cmd.exe
process won't do it.
Start-Process cmd -Argument "/c cntkpy34.bat" -RedirectStandardOutput somefile
This will open a new cmd window and run that there
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With