FrancineTaylor
asked on
What is the C# equivalent of the VB.NET Shell command?
Here's the code I need an equivalent for:
Shell("C:\Program Files\WinZip\wzzip -sPa$$pHr@$E47 -ycAES256 " & Left(fil.Path, fil.Path.Length - 4) & ".zip " & fil.Path, AppWinStyle.NormalFocus, True, 60000)
Shell("C:\Program Files\WinZip\wzzip -sPa$$pHr@$E47 -ycAES256 " & Left(fil.Path, fil.Path.Length - 4) & ".zip " & fil.Path, AppWinStyle.NormalFocus, True, 60000)
Hi FrancineTaylor,
You can try this:
Interaction.Shell("C:\\Pro gram Files\\WinZip\\wzzip -sPa$$pHr@$E47 -ycAES256 " + Strings.Left(fil.Path, fil.Path.Length - 4) + ".zip " + fil.Path, AppWinStyle.NormalFocus, true, 60000);
Here is the convertor from C# to vb.net. You can try it for other conversion as well.
You can try this:
Interaction.Shell("C:\\Pro
Here is the convertor from C# to vb.net. You can try it for other conversion as well.
Sorry, I forgot to use escape characters
shell.StartInfo.FileName = "C:\\Program Files\\WinZip\\wzzip.exe";
correction to the last line
shell.StartInfo.Arguments = "-sPa$$pHr@$E47 -ycAES256 " + shell.StartInfo.FileName.Substring(0, shell.StartInfo.FileName.Length - 4) + ".zip " + shell.StartInfo.FileName;
Use the System.Diagnostics.Process () class:
Process.Start()
Process.Start()
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Aha! Thank you, Darren, I was just composing another question...you just answered it!
You guys are great, thanks!
You guys are great, thanks!
ASKER
Thanks again! You're awesome.
Open in new window