Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Guys,

I need your help I'm trying to zip a file using a shell method in C# but I keep on having the error that says The name Shell does not exit in the current context.Please help this is my first time to use this shell method :((

this is the method :

Shell("C:\\Program Files\\WinZip\\WZZIP.EXE C:\\Destination DownloadFile");
Posted

System.Diagnostics.ProcessStartInfo ps = new System.Diagnostics.ProcessStartInfo();
ps.UseShellExecute = true;
ps.Arguments = "C:\\Destination DownloadFile";
ps.FileName = "C:\\Program Files\\WinZip\\WZZIP.EXE";
System.Diagnostics.Process p = System.Diagnostics.Process.Start(ps);
p.WaitForExit();
 
Share this answer
 
Comments
JGraduate 27-Sep-10 5:02am    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
JGraduate 27-Sep-10 5:08am    
Thanx,But its not creating the zipped file in the C:\ drive :-(
JGraduate 27-Sep-10 5:17am    
Oh! never mind I saw what I did wrong.

Many thanks.

Regards,
J
You can find Shell in the Microsoft.VisualBasic.Compatibility namespace, but you may also wish to investigate the System.IO.Compression.GZipStream namespace which provides functionality for file/data compression.
 
Share this answer
 
Comments
JGraduate 27-Sep-10 5:12am    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
JGraduate 27-Sep-10 5:17am    
Thanx Guys

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900