0

If I place the same file in another folder location it works fine.

This is the code I am currently using

 `Process UninstallCmd = new Process();
  UninstallCmd.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
  UninstallCmd.StartInfo.FileName = "cmd.exe";           
  UninstallCmd.StartInfo.Arguments = "/C C:\\Program Files\\Program\\uninst.exe /S";
  UninstallCmd.StartInfo.Verb = "runas";
  UninstallCmd.Start();
TheGeneral
  • 79,002
  • 9
  • 103
  • 141
Jnewbie
  • 1
  • 2
  • `cmd.exe` is not the `FileName`. `uninst.exe` is. – mjwills Mar 15 '18 at 12:14
  • @mjwills `FileName` is the process that will be started, `uninst.exe` is what the CMD will run – Camilo Terevinto Mar 15 '18 at 12:15
  • I understand that @CamiloTerevinto . But that is the wrong way of doing it. There is literally no need for `cmd.exe` to be involved. – mjwills Mar 15 '18 at 12:17
  • If i change the file location to for example c:\test\program\\uninst.exe /S. It works perfectly. Do you think there is a restriction for the Program files folder? – Jnewbie Mar 21 '18 at 11:06

0 Answers0