Run a cmd script


I found this command, to run a cmd script:

Execute-Process -Path "C:\Windows\System32\cmd.exe" -Parameters "$dirfiles\install.cmd" -Wait

I tried it, and it gets stuck somewhere, the file is not executed, the file just does:
type nul > C:\Install\123.txt

I got the message, that the installation is running, “please wiat…” but then nothing happens.

You forgot the /C

Execute-Process -Path "C:\Windows\System32\cmd.exe" -Parameters "/C $dirfiles\install.cmd" -Wait

This explains what the /C is for

Thanks, i did it in the meantime with that command:

Execute-Process -Path “$dirFiles\install.cmd” -Wait

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.