![]() ![]() Alternatively, you could cd to the appropriate folder in the powershell script and code with the appropriate precautions (like checking the return codes of commands - like cd ).However, this will execute the powershell script even if the cd command was not successful. With cmd powershell, you ask the current shell, explorer, to invoke cmd with parameters powershell, 'imageSeqView. start-process c:windowssystem32cmd.exe /c 'C:Program Filessoftwaredo. ![]() C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe /c "c: cd "c:\path\where\you\want\the files" C:\path\to\powershell_script.ps1" Running CMD in PowerShell with spaces in the parameters If like me, you have spent hours trying to spawn a command shell from a PowerShell script when the arguments for the CMD command include a path with spaces, look no further.C:\Windows\System32\cmd.exe /c "c:
0 Comments
Leave a Reply. |