From: bbcdancer on
Problems with un-zipping a zip file using a bat file. Unable to Del
and rename files. It always prompt to the H:\ directory in the DOS
window and not the C:\ directory. What am I doing wrong?

IN DOS Window results
-------------------------------------------------
H:\>cd C:\aaa\bbb\ccc

H:\ del file1.txt
Could Not Find H:\file1.txt

H:\ del file2.txt
Could Not Find H:\file2.txt
----------------------------------------------

------------------------------------
1. VBA code in MS Access to call bat file:
-------------------------------------------
Call Shell(Environ$("COMSPEC") & " /c C:\unzip.bat", vbNormalFocus)
-------------------------------------------

2. unzip.bat file script is run via VBA:
-----------------------------------------
cd C:\aaa\bbb\ccc

del fileA11.txt
del fileA22.txt
:prompt off
C:\progra~1\winzip\wzunzip -e Downloadfiles.zip C:\aaa\bbb\ccc
ren C:\aaa\bbb\ccc\fileA*.dat fileB*.txt
pause
-----------------------------------------

From: Scott Seligman on
bbcdancer(a)hotmail.com wrote:
>Problems with un-zipping a zip file using a bat file. Unable to Del and
>rename files. It always prompt to the H:\ directory in the DOS window
>and not the C:\ directory. What am I doing wrong?

For no doubt historical reasons, CD changes the current path without
changing the drive. If you have a reasonably modern batch parser, you
can pass CD the /d option to make it change drives as well.

--
--------- Scott Seligman <scott at <firstname> and michelle dot net> ---------
The most exciting phrase to hear in science, the one that heralds new
discoveries, is not 'Eureka!' but 'That's funny...'
-- Isaac Asimov