If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to start and Access DB from a bat-file
What would the command line be to start a specific Access DB from a bat-fil?
-- Diane |
#2
|
|||
|
|||
How to start and Access DB from a bat-file
"DianePDavies" wrote in message
... What would the command line be to start a specific Access DB from a bat-fil? Start "YourWindowTitle" "C:\YourDataFolder\YourDB.mdb" The double-quotes are needed if your arguments contain any spaces, but including them is ok either way. |
#3
|
|||
|
|||
How to start and Access DB from a bat-file
hi Diane,
On 08.04.2010 13:34, DianePDavies wrote: What would the command line be to start a specific Access DB from a bat-fil? start "FullPath\Database.mdb" For further control of Access from the command line, take a look at http://support.microsoft.com/kb/209207 The command line in general: http://www.microsoft.com/resources/d...us/ntcmds.mspx http://commandwindows.com/ mfG -- stefan -- |
#4
|
|||
|
|||
How to start and Access DB from a bat-file
Now it works with:
"C:\Program Files\Microsoft Office\OFFICE11 \MSACCESS.EXE" "C:\DEMO\A.mde" However - I would like to place the bat-file in the same folder as A.mde and then not adress A.mde with a full path - similarly I would like to start MSACCESS.EXE without a full path. If I can do that I dont need to worry about the specific location on the various user PCs. I believe there is a constant for the path to office-programs... and I would assume it is possible to address A.mde locally? Any suggestions? -- Diane "Stefan Hoffmann" wrote: hi Diane, On 08.04.2010 13:34, DianePDavies wrote: What would the command line be to start a specific Access DB from a bat-fil? start "FullPath\Database.mdb" For further control of Access from the command line, take a look at http://support.microsoft.com/kb/209207 The command line in general: http://www.microsoft.com/resources/d...us/ntcmds.mspx http://commandwindows.com/ mfG -- stefan -- . |
#5
|
|||
|
|||
How to start and Access DB from a bat-file
hi Diane,
On 12.04.2010 16:34, DianePDavies wrote: Now it works with: "C:\Program Files\Microsoft Office\OFFICE11 \MSACCESS.EXE" "C:\DEMO\A.mde" However - I would like to place the bat-file in the same folder as A.mde and then not adress A.mde with a full path - similarly I would like to start MSACCESS.EXE without a full path. You always need to specifiy the full path to Access except in one case: If you don't care which possible installed Access version is used then you may simply use Start "C:\DEMO\A.mde" in your batch. You may omit the path to the database file, but then your batch does not work under some circumstances, e.g. Store your batch under C:\DEMO\Test.cmd with Start A.mde command line. Open a command line window and switch to the root, C:\. On C:\ execute your batch: C:\\Demo\Test.cmd This will fail due to the wrong current working directory. mfG -- stefan -- |
#6
|
|||
|
|||
How to start and Access DB from a bat-file
Now I have the problem that my batch-file stays open while the database is
open. When I shut down the database the command prompt shuts down too - or if I click the "x" in the top right corner - but I would like it to close right after the command to start the database. How is that done? -- Diane "Stefan Hoffmann" wrote: hi Diane, On 12.04.2010 16:34, DianePDavies wrote: Now it works with: "C:\Program Files\Microsoft Office\OFFICE11 \MSACCESS.EXE" "C:\DEMO\A.mde" However - I would like to place the bat-file in the same folder as A.mde and then not adress A.mde with a full path - similarly I would like to start MSACCESS.EXE without a full path. You always need to specifiy the full path to Access except in one case: If you don't care which possible installed Access version is used then you may simply use Start "C:\DEMO\A.mde" in your batch. You may omit the path to the database file, but then your batch does not work under some circumstances, e.g. Store your batch under C:\DEMO\Test.cmd with Start A.mde command line. Open a command line window and switch to the root, C:\. On C:\ execute your batch: C:\\Demo\Test.cmd This will fail due to the wrong current working directory. mfG -- stefan -- . |
#7
|
|||
|
|||
How to start and Access DB from a bat-file
hi Diane,
On 13.04.2010 11:29, DianePDavies wrote: Now I have the problem that my batch-file stays open while the database is open. When I shut down the database the command prompt shuts down too - or if I click the "x" in the top right corner - but I would like it to close right after the command to start the database. I wonder if you're heading into the right direction with a batch. What are you trying to achieve? Have you considered using a simple link instead of a batch? Maybe you using a front-end update tool like http://autofeupdater.com/ is what you need. mfG -- stefan -- |
#8
|
|||
|
|||
How to start and Access DB from a bat-file
What exact command(s) did you use in the batch file? I have many clients
using the Start command that Stefan listed below, and the command window closes as soon as the call to start the db is processed. If you're copying the current frontend and then starting it up, there should be two commands in the batch file: copy /y "\\MyServer\MyPath\A.mde" "C:\Demo\A.mde" Start "C:\DEMO\A.mde" "DianePDavies" wrote in message ... Now I have the problem that my batch-file stays open while the database is open. When I shut down the database the command prompt shuts down too - or if I click the "x" in the top right corner - but I would like it to close right after the command to start the database. How is that done? -- Diane "Stefan Hoffmann" wrote: hi Diane, On 12.04.2010 16:34, DianePDavies wrote: Now it works with: "C:\Program Files\Microsoft Office\OFFICE11 \MSACCESS.EXE" "C:\DEMO\A.mde" However - I would like to place the bat-file in the same folder as A.mde and then not adress A.mde with a full path - similarly I would like to start MSACCESS.EXE without a full path. You always need to specifiy the full path to Access except in one case: If you don't care which possible installed Access version is used then you may simply use Start "C:\DEMO\A.mde" in your batch. You may omit the path to the database file, but then your batch does not work under some circumstances, e.g. Store your batch under C:\DEMO\Test.cmd with Start A.mde command line. Open a command line window and switch to the root, C:\. On C:\ execute your batch: C:\\Demo\Test.cmd This will fail due to the wrong current working directory. mfG -- stefan -- |
#9
|
|||
|
|||
How to start and Access DB from a bat-file
If my command looks exactly like you suggest:
start "C:\DEMO\A.mde" I just open a command prompt with the title "C:\DEMO\A.mde" If I have the following: "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "C:\DEMO\A.mde" This starts my database but the command prompt stays open until I close the databas (or exits the prompt manually by clicking the "x" in the corner). -- Diane "Paul Shapiro" wrote: What exact command(s) did you use in the batch file? I have many clients using the Start command that Stefan listed below, and the command window closes as soon as the call to start the db is processed. If you're copying the current frontend and then starting it up, there should be two commands in the batch file: copy /y "\\MyServer\MyPath\A.mde" "C:\Demo\A.mde" Start "C:\DEMO\A.mde" "DianePDavies" wrote in message ... Now I have the problem that my batch-file stays open while the database is open. When I shut down the database the command prompt shuts down too - or if I click the "x" in the top right corner - but I would like it to close right after the command to start the database. How is that done? -- Diane "Stefan Hoffmann" wrote: hi Diane, On 12.04.2010 16:34, DianePDavies wrote: Now it works with: "C:\Program Files\Microsoft Office\OFFICE11 \MSACCESS.EXE" "C:\DEMO\A.mde" However - I would like to place the bat-file in the same folder as A.mde and then not adress A.mde with a full path - similarly I would like to start MSACCESS.EXE without a full path. You always need to specifiy the full path to Access except in one case: If you don't care which possible installed Access version is used then you may simply use Start "C:\DEMO\A.mde" in your batch. You may omit the path to the database file, but then your batch does not work under some circumstances, e.g. Store your batch under C:\DEMO\Test.cmd with Start A.mde command line. Open a command line window and switch to the root, C:\. On C:\ execute your batch: C:\\Demo\Test.cmd This will fail due to the wrong current working directory. mfG -- stefan -- . |
#10
|
|||
|
|||
How to start and Access DB from a bat-file
Sorry, I think there's a parameter omitted from the Start command.
start "My Window Name" "C:\DEMO\A.mde" You can get the full documentation for the start command by typing help start in a command window. An excerpt from the help: Starts a separate window to run a specified program or command. START ["title"] [/D path] [/i] [/MIN] [/MAX] [/SEPARATE | /SHARED] [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL] [/AFFINITY hex affinity] [/WAIT] [/b] [command/program] [parameters] "title" Title to display in window title bar. path Starting directory. "DianePDavies" wrote in message ... If my command looks exactly like you suggest: start "C:\DEMO\A.mde" I just open a command prompt with the title "C:\DEMO\A.mde" If I have the following: "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "C:\DEMO\A.mde" This starts my database but the command prompt stays open until I close the databas (or exits the prompt manually by clicking the "x" in the corner). -- Diane "Paul Shapiro" wrote: What exact command(s) did you use in the batch file? I have many clients using the Start command that Stefan listed below, and the command window closes as soon as the call to start the db is processed. If you're copying the current frontend and then starting it up, there should be two commands in the batch file: copy /y "\\MyServer\MyPath\A.mde" "C:\Demo\A.mde" Start "C:\DEMO\A.mde" "DianePDavies" wrote in message ... Now I have the problem that my batch-file stays open while the database is open. When I shut down the database the command prompt shuts down too - or if I click the "x" in the top right corner - but I would like it to close right after the command to start the database. How is that done? -- Diane "Stefan Hoffmann" wrote: hi Diane, On 12.04.2010 16:34, DianePDavies wrote: Now it works with: "C:\Program Files\Microsoft Office\OFFICE11 \MSACCESS.EXE" "C:\DEMO\A.mde" However - I would like to place the bat-file in the same folder as A.mde and then not adress A.mde with a full path - similarly I would like to start MSACCESS.EXE without a full path. You always need to specifiy the full path to Access except in one case: If you don't care which possible installed Access version is used then you may simply use Start "C:\DEMO\A.mde" in your batch. You may omit the path to the database file, but then your batch does not work under some circumstances, e.g. Store your batch under C:\DEMO\Test.cmd with Start A.mde command line. Open a command line window and switch to the root, C:\. On C:\ execute your batch: C:\\Demo\Test.cmd This will fail due to the wrong current working directory. mfG -- stefan -- |
Thread Tools | |
Display Modes | |
|
|