How do you call a .bat file from code?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have tried a variety of combinations in the previous posts:

Shell "\\ngclds00\etb\databases\rawdata\proaxiom (do not remove).bat",
vbMinimizedNoFocus

Shell "cmd.exe /C ""\\ngclds00\etb\databases\rawdata\proaxiom (do not
remove).bat"""

But I cannot get the .bat file to run. I have never ran anything like this
before and do not know where I am going wrong.

Any help would be appreciated.
 
In
fishy said:
I have tried a variety of combinations in the previous posts:

Shell "\\ngclds00\etb\databases\rawdata\proaxiom (do not remove).bat",
vbMinimizedNoFocus

Shell "cmd.exe /C ""\\ngclds00\etb\databases\rawdata\proaxiom (do not
remove).bat"""

But I cannot get the .bat file to run. I have never ran anything like
this before and do not know where I am going wrong.

Any help would be appreciated.

The second one:

Shell "cmd.exe /C ""\\ngclds00\etb\databases\rawdata\proaxiom (do
not remove).bat"""

.... looks to me like it should work. How certain are you that the .bat
file isn't running? Are you getting an error message? You could try
getting the return code from the Shell function:

Debug.Print Shell("cmd.exe /C
""\\ngclds00\etb\databases\rawdata\proaxiom (do not remove).bat""")

If the return code is nonzero, that implies that the process was
successfully run.
 
the bat file should rename a series of files. when I run this outside of
access it works.

Will try at work tomorrow and advise.
 
Back
Top