Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending arguments to the command line

I need to unzip a compressed file with the command line version of 7zip. This one liner should to the trick:

Process.Start("cmd", @"C:\Users\cw\Downloads\7za920\7za e C:\UPDATED.zip -oc:\");

I'm specifying the path to the 7zip command line executable, and telling it which file to unzip. If I copy and paste those arguments into my command line window, it will work. In C#, it will bring up a command line window, and nothing will happen. What gives?

like image 309
broke Avatar asked Dec 06 '25 02:12

broke


1 Answers

Try:

Process.Start("cmd", @"/c C:\Users\cw\Downloads\7za920\7za e C:\UPDATED.zip -oc:\"); 
like image 107
Joe Avatar answered Dec 07 '25 16:12

Joe