buzzboychicago
Programmer
- Sep 20, 2004
- 34
Okay, I am trying to write a batch file as many post have suggested to use to distribute and update copies of the latest frontend of my access database. The below post explains some of the coding. However, I am very new and have no idea where to even put that code. I tried creating a text file and saving it as a .bat file from notepad and tried to run it.
The code contained was as follows
c:
mkdir testcreatedirectory
but after I ran it the directory was no where to be found. is there a beggining or and end that I am leaving out or something?
****
Hi,
I have an adp which I distribute around the office by the use of a batch file..
Like the following..
1. make a batch file like this on your server
Update.bat
------------------------------------------------------
rem make the directories (no harm if they're already there)
c:
cd\
cd "Program Files"
mkdir "OrderEntry Database"
cd "OrderEntry Database"
rem If the latest version file is on the PC, just start the database
if exist "OrderEntry_Database.1.24.txt" goto Startup
copy "\\ServerName\Databases\webImport\Orders.lnk"
copy "Orders.lnk" "C:\Documents and Settings\All Users\Start Menu\Orders.lnk"
copy "Orders.lnk" "C:\Documents and Settings\All Users\Desktop\Orders.lnk"
rem Copy a new front end
copy "\\ServerName\Databases\webImport\Orders.adp"
copy "\\ServerName\Databases\webImport\OrderEntry_Database.1.24.txt"
copy "\\ServerName\Databases\webImport\dll\ImportSpec\SpecDB.mdb"
copy "\\ServerName\Databases\webImport\dll\ImportSpec\TsiImpExp100.mde"
:Startup
rem fire it up
"C:\Program Files\Microsoft Office\Office10\msaccess.exe" "c:\Program Files\OrderEntry Database\orders.adp"
exit
---------------------------------------
2. make an empty text file like OrderEntry_Database.1.24.txt
Place this on the server also.
3. Make a Shortcut that points to the batch File.
Copy this shortcut to the local computer and run it.
What Happens.
1. The shortcust executes the batch file.
The batch file check if the file OrderEntry_Database.1.24.txt exists on the server. If it does, it copies down the other files to the local server. Then executes the adp file.
The beauty of this is that you can work locally on you dev version, then when your ready to update your live version, all you do is
Update the batch file with the new file name like
OrderEntry_Database.1.24.txt to
OrderEntry_Database.1.25.txt
and then change the file named OrderEntry_Database.1.24.txt to OrderEntry_Database.1.25.txt