A similar question was asked several times on SO, and usually the answer is one of:
- run the same command on PowerShell because it's also there
- run
cmdand then the commands - invoke
cmdpassing/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.
cntkpy34.batfile. And if you can not edit that file, then just satisfy that condition with that PowerShell command:$env:CMDCMDLINE=$env:COMSPEC.cmd.exewith no args) and I'm not sure that's safe because it has to activate an Anaconda environment. I'll try it anyway.