C
C#14mo ago
João Paul

✅ Running cmd line command via c# not working

Hello everyone. I have the following code: kioskProcess = new Process { StartInfo = { FileName = "cmd.exe", WorkingDirectory = Constants.KioskPath, Arguments = @"npm start", UseShellExecute = false, } }; kioskProcess.Start(); If I run this, the command line opens and goes to the working directory correctly but never runs the "npm start". Am I doing something really stupid here?
3 Replies
Ꜳåąɐȁặⱥᴀᴬ
i remember that you should have to use an argument to execute a command in cmd, something like /k or /c use cmd /help to look at the switches
João Paul
João PaulOP14mo ago
the /k worked. Thanks a lot 😄
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View

Did you find this page helpful?