I'm trying to help my DB Admin write a logon script that will run when any user logs on. What this script needs to do is check a notepad file for a version number on the clients machine and if that file is not current then it will copy the current DB file over along with the current notepad file.

c:\datastaff\1.1.4.txt is not the current DB it needs to be 1.1.5.txt

So it needs to copy z:\datastaff\datastaff.mdb & z:\datastaff\1.1.5.txt (z: is a network drive that is mapped automatically for all users) over to c:\datastaff.

This is the current script that we are trying. It is a .bat file. When we run it it says that access is denied. The network drive everyone has Read/Write/Modify rights to it and the folder on the c: all users have the same permissions as well. Here is the script that we have been trying.

rem Copy a new front end if the newest version file is not present

cd..

cd..

cd..

if not exist "c:\DataStaff1\VersionNumber1.1.4.txt" copy/y "z:\Naomi\Datastaff\DataStaff.mdb"

if not exist "c:\DataStaff1\VersionNumber1.1.4.txt" copy/y "z:\Naomi\Datastaff\VersionNumber1.1.4.txt"

Why this - if you are running the batch file from your server, at say a netlogin share, the batch file will fail because you are trying to traverse up the directory structure of the server drive - which probably most users don't have permission for. Thus the batch file will fail as there is no error handling

The reason for the cd.. is to make the cmd prompt go to the root directory, then we need the cmd prompt to go to the c: drive if it is not already there. Here is the new code that my DB Admin just showed me.

rem Copy a new front end if the newest version file is not present

cd..

cd..

cd..
C:
cd DataStaff1

if not exist "c:\DataStaff1\VersionNumber1.1.8.txt" copy/y "z:\Naomi\DataStaff.mdb"

if not exist "c:\DataStaff1\VersionNumber1.1.8.txt" copy/y "z:\Naomi\VersionNumber1.1.8.txt"