WinExec? Shell? File Copy, zip, unzip problem!
Posted on 1998-05-15
I am using MS Access 2.0 under Windows 95.
I used WINEXEC and Shell to run a batch file in the background so the MS DOS window does not show up. The batch file actually copy a zip file from DriveA into c:\dir and then run pkunzip on that file.
On the reverse, I run another batch file to zip up a mdb file and copy it back to Drive A.
This is where to problem starts. I think the batch file is not able to execute all the commands smoothly because one of the zip or mdb file got "locked" (Acccess denied) along the way.
I press Ctrl-Alt-Del to bring up the Task Manager and I found that a few "Winoldap" is opened. After I manually end-task these few "Winoldap", I could then access that "locked" file. Note that the file is still "locked" even after I closed Access.
I wonder if this is due to the process not ended properly?
The following it the code I used a RunCode macro to execute:
Function CopyIn ()
Success = WinExec("c:\dir\copyin.bat, SW_HIDE)
I hope someone have a detailed answer.