access not finding file when run from batch file


I have a batch file running on a client PC with a single line which looks like this (server name etc changed for security reasons)

"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" "\\mySserver\myDirectory\myDatabase.mdb" /cmd "myParameter"

When I run the file on the client PC by double clicking it, it runs perfectly fine and opens the database with the parameter. When I run the file from myServer over the network it opens access and I get an error message which reads 'Microsoft Access can't find the database \\mySserver\myDirectory\myDatabase.mdb'

I don't understand why the same batch file will run correctly locally but not when run over the server. I've tried putting echo hello just to test the batch file is running properly and it is fine.

So is this a problem with access? Should I write the path differently? I've tried using the same system to run a local database file and hit exactly the same issue.

Please help! I'm tearing my brain out through my eye sockets on this one!

Thank you :)
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewIT / Software Engineering ConsultantCommented:
How are you running the bat file remotely?  What credentials are being used in each case?

daz84Author Commented:
I am using pcexec from with the following command line

psexec "\\myClient" -i "C:/myDirectory/myBatch.bat"

that line is actually called using the shell function in a VB6 program

the batch file runs perfectly well when called remotely from the VB6 software on the server, it will display echos and will open access application, it just wont find the file. When run directly by double clicking on the batch file on the client computer it does exactly the same, but it does find the file and opens the .mdb as expected.

I just can't understand why there is any difference
Bill PrewIT / Software Engineering ConsultantCommented:
When you run the bat file locally (not via PSEXEC) what user are you logged in as on the local machine?  Is it the same user in the domain that you are using when you run it remotely via PSEXEC?  If not then you may be running as some other user like GUEST on the remote computer that doesn't have access to the share location.  There are command line parms in PSEXEC that allow specification of the user id and password to execute on the remote system.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

daz84Author Commented:
That could well be the solution! I have been logged on to client PC as admin, although all users should have access to shared folder. I will give the -u -p params a try
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
If that doesn't work try this:

"\\mySserver\myDirectory\myDatabase.mdb /cmd  myParameter"
daz84Author Commented:
Thanks for your efforts, neither of those solutions proved to be the case though

I am positive it is something to do with permissions but I can't find anything else to set!

It's gonna be a long night for me, this is meant to be going live tomorrow :(
Steve KnightIT ConsultancyCommented:
not on a pc now to advise syntax but may be worth seeing if schtasks or at command set to run asap would give you what you need at all?
daz84Author Commented:
Sorry, I'm not sure what you mean?
Steve KnightIT ConsultancyCommented:
instead of using psexec i meant.  you can run schtasks or at to schedule a job to run on a remote pc from commandline too.

Schtasks /? Or at /? From a cmd.exe prompt will give you the syntax or will  suggest when i can later.
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
I guess we are now in need of debugging. If you think it is worth the effort:
* download ProcMon (,
* run it on a client,
* set a filter "Path", "contains", "\\mySserver",
* and start the file the way it does NOT work.
As soon as you get nothing (or the error), press the "magnifier glass" to stop capturing.
You might see a lot of lines - but most interesting is any failure, in particular if it is not followed by success for the same path or file.
If you want to quick-jump to a path contained in the log, select the line, and press Ctrl-J.
Steve KnightIT ConsultancyCommented:
Debugging is a good plan, a quick google showed the commandline options of schtasks here:


schtasks /create /tn My Task /tr "C:\myDirectory\myBatch.bat" /sc ONLOGON /s PCNAME

to start your batch each time someone logs on to the computer

or you could AT:

at \\computer /interactive hh:mm "yourcommand.cmd"

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
As stated earlier:

Did you check the permissions on the SERVER folder hosting the database? In order for users to run the database they'll need at least Modify permissions on that folder (most times you would provide Full permissions). Users must be able to create/destroy files in that location (Access creates/destroys locking files when a database is run).
daz84Author Commented:
Still got nothing working on this, had a network engineer out for three hours and still no luck. Going on-site today and will possibly be looking at workarounds involving copying tables out of the back end onto the client and passing the changes back, rather than opening the actual database on the server
daz84Author Commented:
I'm going to close this now and award points to those who have been helpful and offered good suggestions. I will pass on any information I can if/when I get this solved.
daz84Author Commented:
Solution to this particular problem not found, but useful hints supplied for future reference
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.