I have a command(.cmd) file with few steps in it. I want to execute this file using a C# code
This is the code I wrote-
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Normal;
startInfo.WorkingDirectory = @"C:\Users\zrana\Desktop\"
startInfo.FileName = @"C:\Users\zrana\Desktop\test.cmd"
process.StartInfo = startInfo;
process.Start();
When I run this program, I get an exception System.ComponentModel.Win32Exception: 'Access is denied'. Is this the right way to do this?