.bat files works fine but errors when run from vb (1 Viewer)

Happy YN

Registered User.
Local time
Today, 09:23
Joined
Jan 27, 2002
Messages
425
I have a bat file which outputs text to an html using awk. The files needed reside in their own folder and all works fine.
However when I call the bat file from within vba (using shell) it opens the bat file but can't find the other files it needs to execute the bat properly.
In fact it seems to be looking for them in the my documents folder????
Why is that? Neither the vb application (access) nor the folder for te bat are anything like the my docs folder.
It seems vb is opening the bat but not within its own folder, but in my docs.
Who told it to do this and can I force it not to
Thanks
 

richary

Registered User.
Local time
Today, 09:23
Joined
May 26, 2004
Messages
167
Had the same problem myself. i don't know why it does this. I solved it by using a fully qualified path name to all files referenced in the .bat file
 

reclusivemonkey

Registered User.
Local time
Today, 09:23
Joined
Oct 5, 2004
Messages
749
Happy YN said:
Who told it to do this

You did. Computers are extremely stupid. They will only do exactly what you told them to; no more, no less. As the previous poster said, it would seem you have no used fully qualified pathnames. Either use them in your batch file, or "cd" to the correct directory (I use this method myself; easier for the lazy typer). Post your batch file if you still have problems.
 

Happy YN

Registered User.
Local time
Today, 09:23
Joined
Jan 27, 2002
Messages
425
Thanks for your replies. However it is difficult for me to provide full pathnames for everything as although it is always the same relative to the vb module, the module could be in various locations.
I still don't know why it resorting to using my documents folder. There must be some setting somewhere that could be overridden.
Thanks again
 

Users who are viewing this thread

Top Bottom