[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 141
  • Last Modified:

Run Application within an Access Macro

Very simply, I am trying to have an Access Macro launch a .bat file as a first step before moving on to other tasks in the macro. I have tried a number of variations to the command line syntax to enter into Access and not having any luck.

I can get the CMD window to open, I can get it to change directories, but I cannot get it to run the batch file

I've tried:

CMD /k cd \53processing\parse.bat
CMD /k ""cd \53processing" "parse.bat""
CMD /k C:\53processing\parse.bat

and probably 3-4 other variations I've found online, none are working.
0
sparker1970
Asked:
sparker1970
1 Solution
 
oBdACommented:
The first two will fail:
1. You can't "cd" into a file
2. "cd \53processing" isn't (in all likelihood) a valid command.
The third version should actually run the batch, provided the file "C:\53processing\parse.bat" does exist. With the /k, the prompt will remain open, and you should be able to see potential errors. Note that the script's working directory will probably not be its own directory, so any processing the batch does with relative paths might fail.
To change the directory and then run the bat from there, try
CMD /k cd /d "C:\53processing"&parse.bat

Open in new window

If you want your macro to continue automatically after the batch is done, you need to replace the /k with /c.
0
 
sparker1970Author Commented:
Worked perfectly...thank you!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now