Solved Creating Batch File to Copy Files & and Start Access App

November 2, 2017 at 10:33:09
Specs: Windows 7
Hi

I need to create a batch file which first copy the MS Access files from "network location A" location to another "network location B" and the start the MS Access App from the "network location B". I was able to perform all of the above when I have the mapped network drive pointing to the "network location A" with the following code:


COPY "S:\Setup\MyDB.accde" "C:\Program Files\Utilities\MyDB.accde"

COPY "S:\Setup\UnlockMyDB.accde" "C:\Utilities\UnlockMyDB.accde"

start "" "C:\Program Files\Utilities\UnlockMyDB.accde"

So basically the above commands copy the required MS Access DB Files to C Drive and then start the application by opening the UnlockMyDB.accde file which unlocks MyDB.accde file.

Now the issue is instead of S:\ drive letter I have UNC path: \\SERVER\ACCESSDATA\FileShare

and instead of C:\ drive letter I have UNC path: \\COMP01\VOL2\HOME\USERID

now how can I change my batch file to copy the contents from path: \\SERVER\ACCESSDATA\FileShare to path: \\COMP01\VOL2\HOME\USERID and then
start the MS Access DB from path: \\COMP01\VOL2\HOME\USERID

Help and guidance will be appreciated.


See More: Creating Batch File to Copy Files & and Start Access App

Reply ↓  Report •

#1
November 2, 2017 at 12:31:41
✔ Best Answer
Just about every text editor has find and replace. I'm not seeing an issue here. Other than assuming the USERID has a "Program Files" and a "Utilities" directories, of course
COPY "\\SERVER\ACCESSDATA\FileShare\Setup\MyDB.accde" "\\COMP01\VOL2\HOME\USERID\Program Files\Utilities\MyDB.accde"
COPY "\\SERVER\ACCESSDATA\FileShare\Setup\UnlockMyDB.accde" "\\COMP01\VOL2\HOME\USERID\Utilities\UnlockMyDB.accde"
start "" "\\COMP01\VOL2\HOME\USERID\Program Files\Utilities\UnlockMyDB.accde"

How To Ask Questions The Smart Way


Reply ↓  Report •

#2
November 2, 2017 at 12:42:25
Thanks Razor2.3

Let me try to update the paths and see if it works; my understanding was UNC paths were not supported.

I will post my results.

Thanks again


Reply ↓  Report •
Related Solutions


Ask Question