Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Shell Function on Network File

Status
Not open for further replies.

NewfieGolfer

Technical User
Mar 29, 2001
80
0
0
CA
Hello,
I'm trying to run a batch file located on a network drive using the shell function in Access 2000. I get the commmand prompt window to appear but in the window it says:

"Your Data Access Path - C:\Docume~\User\MyDocu~ - is Invalid Press any key..."

Is this error occuring because I'm trying to access a network file? Here's my code i'm using

file = "M:\example\program batchfile"
I = Shell(file, 1)

If I type the above file in the run box in the start menu I can get it to work. But not when I'm trying to do it with the shell function.

Can someone help?
Thanks,

NG
 
yep you may find it to be the following, Msdos does not handel long file extentions you will have to write it as follows.

Also what is the name of the file I notice it is not displayed.. It will come up with an error if you do not request the file.


file = "M:\exampl~1\progra~1"
I = Shell(file, 1)

or

Dim retval
retval = Shell("M:\exampl~1\progra~1\file.com", 0)

The 0 at the end hides the dos window so that the user can not see what is going on.

Now one other possible problem if the above does not work check you windows version I know I have problems with XP and 2000 when it comes to Dos, it seems like Bill has decided to remove a few backend commands. I recently wrote a batch file where I actually had to move through directories to do things eg.
cd windows
cd system32
del *.doc
cd..
cd..
and so on and so on, real pain in the arss stuff.

Hope this helps

Zero Anarchy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top