Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing Shell command form VB.net

Status
Not open for further replies.

chicdog

Programmer
Feb 28, 2002
84
US
I'm trying to execute a zip file located at the location that is shown in the text field of txtZipFile using PKzip. Is this the right format? I'm not sure it's reading correctly. The code I have so far is below. Thanks in advance.

Bryan


Dim AppName As String """C:\ProgramFiles\PKWARE\PKZIP4 \pkzipw.exe" & txtZipFile.Text & ""
Shell(AppName, AppWinStyle.NormalFocus)
 
I wrote a wrapper for a command line program that works ok.

Couple things:

1. You have a lot of """""'s in that string.
2. I used the Call command in my code.
3. ProgamFiles is usually spelled Program Files
4. You usually have to have a space after the application name and no spaces between directories.

I was thinking of something like this:

Dim sCmdLine As String
sCmdLine = "C:\Program Files\PKWARE\PKZIP4\pkzipw.exe " & txtZipFile.Text
Call Shell(sCmdLine, AppWinStyle.NormalFocus)

The following is a link to the wrapper program I mentioned above. It has a shell command that works.

Kris
[pc3]
 
Thank you your example of the spell check. It seems to work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top