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

Running External Program

Status
Not open for further replies.

dcomartin

Programmer
May 12, 2003
27
0
0
CA
Alright, I am using dBase IV and I am trying to call pkunzip from within my application. pkunzip and the file im trying to unzip are located in the same directory as the application.

!pkunzip -d myfile.zip

All this does is crash my application. So my question is, how can I call an external application with arguments?
 
I have dBase5 for DOS, which should not be too disimilar, and PKZIP version 2.5 (DOS-based version released in 1999) works fine for me. Are you trying to run the DOS version of PKZIP/PKUNZIP? I'm not sure what would happen if you called the Windows version from DOS-based dBase. What is the error number? Is PKUNZIP not found, or is it some other problem? "Crash my application" is not much to go on, as a lot of things could do the same thing. As a guess, could it be that the dBase PATH does not match the DOS PATH?
 
I have no idea what the error number is because when that line gets executed:

!pkunzip -d myfile.zip

my application completely closes. No errors, it just closes.
 
It is pkunzip that is causing my problems. If i call any other program it works. If i create a batch file that contins has just "pkunzip" in it, and i call that batch file, it crashes. What other dos program can i use to unzip?
 
Just for S & G's rather than using !pkunzip..., try using run pkunzip..... Also, make sure that the zip file is in the same directory as your dbase files. One last thought, remove the -d (delete) switch from the unzip command. This is more easily accomplished using dbase commands.

There's always a better way...
 
Problem solved. I had to add the "-3" switch when calling pkunzip. This is odd because I don't have to use it when I call pkunzip from the dos prompt. Anyways the "-3" is for:

"Disable 32-bit instruction usage on 80386 or higher CPU's"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top