Strange .bat file problem

captnk

Registered User.
Local time
Today, 00:31
Joined
Dec 12, 2001
Messages
148
I recently put in a batch file which runs from a code shell.
However initially it wouldnt run.
The bat file would run perfectly if that was cliked,but would not execute from code.
after much research it became apparent that it was looking up the wrong directory (default directory) e:\my docs etc.
It was only after i change the default directory to where the data for this .bat file was...d:\......,that it would work.
Strange I have other bat files in the prog without that problem,just this particular one,and YES I did cd etc and chdir,but it seemed to ignore them
It doesnt seem to have any consequences on the prog as yet.
Just wonder if af others have had this happen,and if their is an obvious quick fix.
 
I think your problem is with long file names

Basicly you need to enclose your shell command in quotes
or use the dos 8.3 name for the path.

try

shell """c:\some long dir\batch.bat"""

or shell "c:\somelo~1\batch.bat"


its something like that anyway




:cool:ShadeZ:cool:
 
Many tks Shadez
I think yr probably right.
The problem actually seems to be with the windows folder \..\My Documents
which of course is well past the Dos 8 characters.
The dos bat file appears to have some problem with that.
As I mentioned I can work around by using my db folder as the default.I just need to road test it a bit to make sure that hasnt created another problem.

Of course access now uses that folder as the default every time u run it....Damn stupid that it sets a global default and not an individual db default
 

Users who are viewing this thread

Back
Top Bottom