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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOS PROGRAMS WITH PARAMETERS

Status
Not open for further replies.

NW

Programmer
Feb 3, 2000
61
GB
Please Help!!!!!!!!!<br>How can I run dos program with parameters from VB?<br>I want to run PKUNZIP (Dos version) & need to pass zip file name as the parameter. <br>
 
Try the Shell function (look in VB help) as in:<br>PathToPKunzip = &quot;C:\PKUNZIP.EXE&quot;<br>NameOfZipFile = &quot;C:\MYSTUFF.ZIP&quot;<br>RetVal = Shell(PathToPKunzip & &quot; &quot; & NameOfZipFile)<br><br>You would want to include any additional parameters (separated by spaces) after PathToPKunzip.<br><br>Hope this helps.<br> <p> <br><a href=mailto:InterruptX@excite.com>InterruptX@excite.com</a><br><a href= Contingency Implementation</a><br>Send me suggestions or comments on my current software project.
 
Thanks for your answer.<br>I have tried it, but it is not unzipping the file instead it shows a warning....<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;filename already exists. Overwrite (y/n/a/r)?<br>I was surprised to see this message as there were no files exists in c:\ with that name.<br>Can you please help me to solve this problem?<br><br>
 
I assume that the warning is coming from PKunzip.<br>If you add the parameter &quot;-o&quot;, PKunzip will automatically overwrite existing files (not always the best option, if you have made changes you want to preserve).<br><br>ZIPoptions = &quot;-o&quot;<br>RetVal = Shell(PathToPKunzip & &quot; &quot; & ZIPoptions & &quot; &quot; & NameOfZipFile)<br> <p> <br><a href=mailto:InterruptX@excite.com>InterruptX@excite.com</a><br><a href= Contingency Implementation</a><br>Send me suggestions or comments on my current software project.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top