Open DB via batch file

Did you change the paths to match YOUR paths. You need to look at YOUR registry to see what the number is for the version of Office AND, to run this file, you need to create a text file with the file type of .rga and run that.
Hi,

Yes I changed the paths and change the version

I am in the dark here, trying to make sense of this, I have never worked with batch files before and not sure on the commands to use
I entered the commands as you have advised
I dont know the difference between regedit and batch commands and only going on what is advised
The samples you have provided has been entered into the batch file but I het the non recognized path

@ECHO OFF

::if not exist "%USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP"
md %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP
del %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\DawSheet.accdb
copy "\\sjo2054\CAMO\DAW Sheet\Engineers\Daw Sheet.accdb" %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\DawSheet.accdb

::)else(

::if exist "%USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP"
::del %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\DawSheet.accdb
::copy "\\sjo2054\CAMO\DAW Sheet\Engineers\Daw Sheet.accdb" %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\DawSheet.accdb
::)



set TrustedKey=[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations]
set TrustedKey=[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations\Eng_DAW_Sheet]
set TrustedKey=[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations\EngDAWSHEETTEMP]
set TrustedKey=[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations\DawSheet]

set dbpath="C:\\%USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\Eng_DAW_Sheet"
set dbpath="C:\\%USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP"
set dbpath="C:\\%USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\DawSheet"
set AllowSubfolders=dword:00000001
set Description="DAW Sheet"
set Date="5/30/2011 3:06 AM"


start %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\DawSheet.accdb
 
Last edited:
Hi
The navigation pane will still be visible even before you enable the macros on the pop up screen, then only will the navigation pane be hidden
No. It won't. You can even try it to be sure.
 
I am in the dark here, trying to make sense of this, I have never worked with batch files before and not sure on the commands to use
And you cannot be bothered to search? :(

 
And you cannot be bothered to search? :(

I actually have done quite a few searches
also looked at VBS script
I am not very familiar with this so I have tried a few ways
Also looking into copying the registry file but also not sure how to copy from a text file to the new computer

As you can see, the code has changed a few times since I started the discussion
 
I actually have done quite a few searches
also looked at VBS script
I am not very familiar with this so I have tried a few ways
Also looking into copying the registry file but also not sure how to copy from a text file to the new computer

As you can see, the code has changed a few times since I started the discussion
DO NOT COPY THE REGISTRY HIVE
Each is unique to the computer. You will come a cropper in short order if you do that.

I must admit I have never done it Pat's way, but then I do not have her experience.?
I have used regedit and the entries in a file. Those files always had a .reg extension and just running then added the entries to the registry.
I have not had the need to delete registry entries yet.

I have found a few still on my computer.
This one I called SaveToNetwork.reg and all it contains is
Code:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLinkedConnections"=dword:00000001

If you are not sure what you are doing, then stop. If you get this wrong, you might have to reinstall Windows, plus your other programs if it goes wrong :(
The registry is not for the faint hearted, believe me. :)

Here is a link from one of the links shown by the last link I posted.
If you do not understand this method, get someone who does.


That method will run from an actual batch file.
I myself would still prefer a reg or rga file as Pat has used, keeping the regedit command in their own file.

Again a quick search brings up how to run a reg file from a batch file.
 
Last edited:
DO NOT COPY THE REGISTRY HIVE
Each is unique to the computer. You will come a cropper in short order if you do that.

I must admit I have never done it Pat's way, but then I do not have her experience.?
I have used regedit and the entries in a file. Those files always had a .reg extension and just running then added the entries to the registry.
I have not had the need to delete registry entries yet.

I have found a few still on my computer.
This one I called SaveToNetwork.reg and all it contains is
Code:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLinkedConnections"=dword:00000001

If you are not sure what you are doing, then stop. If you get this wrong, you might have to reinstall Windows, plus your other programs if it goes wrong :(
The registry is not for the faint hearted, believe me. :)

Here is a link from one of the links shown by the last link I posted.
If you do not understand this method, get someone who does.


That method will run from an actual batch file.
I myself would still prefer a reg or rga file as Pat has used, keeping the regedit command in their own file.

Again a quick search brings up how to run a reg file from a batch file.
I realized my error
My batch file is a .bat
The registry file is a reg editor file
As you mentioned, I was giving the incorrect commands and did not understand why you stated that

I will have a look at the link you sent
Much appreciated
 
Hi
Just to confirm, if a location is trusted, I will net get the enable macro warning, correct?
 
Hi
Just to confirm, if a location is trusted, I will net get the enable macro warning, correct?
I'd say not necessarily. Typically, on a normal computer, that would be the case. But, if you're in a corporate environment with an IT department, they could have implemented a group policy where macros are not automatically enabled, and trusted locations may not have any effect on them. Just give it a try and find out for yourself. Let us know how it goes.
 

Users who are viewing this thread

Back
Top Bottom