MS Access Creates File That Spawned Batch File Can't See

  • Thread starter Thread starter Bruce Scherzinger
  • Start date Start date
B

Bruce Scherzinger

This happens in Windows 2000, but not Windows 98.

I have an Access 97 database macro that outputs a report to a text
file. Afterwards, it runs a DOS batch procedure to do some
post-processing (blank line removal and conversion to Unix format).
The batch procedure cannot see the file, even though it is clearly
there. I have enabled echo so I can see what's going on, verify the
execution location, and even added a check for existence of the file
(originally, it was just trying to manipulate it). Neither the "if
exist" or "copy" command sees the file.

I can open a DOS box manually and run the same batch procedure and it
works fine, even with Access still running; so it would not appear to
be a permission thing. It's only the spawned process that cannot see
the file.

What's up with that?

Thanks in advance,
Bruce
Vienna, VA
 
- Please post your batch file here.
- What does your batch file report against this command:
echo Program Files=%ProgramFiles%
 
I figured out what was happening. Under Win98, we had to invoke the batch
procedure in Access via a .PIF file. In Win2000, this invokes a shell that
doesn't handle long file names at all (not even with "if exist" and "del").
The solution was simple. Change the Access macros to simply launch the .BAT
file directly. Works like a champ now.

Bruce
 
Back
Top