Simple batch file

M

Martin Wilson

Hello,

I would like to create a Windows shortcut that copies a our production
database on the server to the users harddrive. Any assistance would be
appreciated.

In particular, I would like suggestions as to how to proceed..batch file etc.
 
S

solex

create a batch file that contains the following command

copy source destination


Martin Wilson said:
Hello,

I would like to create a Windows shortcut that copies a our production
database on the server to the users harddrive. Any assistance would be
appreciated.

In particular, I would like suggestions as to how to proceed..batch file
etc.
 
P

Peter Martin

Martin,

I use something like this. If you don't know or forgot batch commands you
can still see the help in Access xp.

@echo off
REM Access startup batch file - put this on a share and have all network
clients point to it.
SET PrgVer=226
SET APP=myapp_
SET SRCDIR=myserverdirectory
SET ACCDIR=%ProgramFiles%\Microsoft Office\Office
REM location of system maintenance htm for 'on timer if file exists quit'
method
SET MTCFILE="%SRCDIR%\data\SysMaint.htm"

REM Don't start if in maint mode
IF NOT EXIST %MTCFILE% goto icons
%MTCFILE%
goto end

REM Fix the icons every time
:icons
DEL "%USERPROFILE%\Desktop\myapp.lnk"
COPY "%SRCDIR%\app\myapp.lnk" "%USERPROFILE%\Desktop"
DEL "%USERPROFILE%\Start Menu\Programs\myapp.lnk"
COPY "%SRCDIR%\app\myapp.lnk" "%USERPROFILE%\Start Menu\Programs"

REM This line if different versions of app for different versions of access.
Suffix _02 for xp, _03 for '03
REM IF EXIST "%ACCDIR%11\MSACCESS.EXE" SET PrgVer=%PrgVer%_03
REM This skips copy if file is correct version
IF EXIST "%APPDATA%\%APP%%prgver%.mdb" goto StartApp ELSE goto DelOld

:DelOld
DEL "%APPDATA%\%APP%*.mdb" /q
COPY /y /b "%SRCDIR%\APP\%APP%%PrgVer%.MDB" "%APPDATA%"

:StartApp
REM Allow either access 02 or 03 to work with it
IF EXIST "%ACCDIR%11\MSACCESS.EXE" goto off11 else goto off10

:eek:ff10
"%ACCDIR%10\MSACCESS.EXE" "%APPDATA%\%APP%%PrgVer%.MDB" /wrkgrp
"%SRCDIR%\data\mysecurity.mdw" %1 %2 %3 %4
goto end

:eek:ff11
"%ACCDIR%11\MSACCESS.EXE" "%APPDATA%\%APP%%PrgVer%.MDB" /wrkgrp
"%SRCDIR%\data\mysecurity.mdw" %1 %2 %3 %4
goto end

:end
SET PrgVer=
SET APP=
SET ACCDIR=
SET SRCDIR=
ECHO ON
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top