• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Search | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

Logon script to update DB files

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Databases

View previous topic :: View next topic  
Author Message
Thrawn717
Just Arrived
Just Arrived


Joined: 28 Mar 2006
Posts: 0


Offline

PostPosted: Thu Apr 12, 2007 12:29 am    Post subject: Logon script to update DB files Reply with quote

Hey All,

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.

How can this be done from the GPO logon\logoff properties?

The current logon script we have been trying is not working!! Twisted Evil

Any help would be great!!
Thanks
James
Back to top
View user's profile Send private message MSN Messenger
stimpy99
Just Arrived
Just Arrived


Joined: 11 Sep 2005
Posts: 0


Offline

PostPosted: Thu Apr 12, 2007 9:31 pm    Post subject: Reply with quote

What is in you current script - might just be a typo - post and everyone can take a gander
Back to top
View user's profile Send private message
Thrawn717
Just Arrived
Just Arrived


Joined: 28 Mar 2006
Posts: 0


Offline

PostPosted: Thu Apr 12, 2007 9:37 pm    Post subject: Reply with quote

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"


if exist "c:\DataStaff1\VersionNumber1.1.3.txt" delete "C:\DataStaff1\VersionNumber1.1.3.txt"
Back to top
View user's profile Send private message MSN Messenger
stimpy99
Just Arrived
Just Arrived


Joined: 11 Sep 2005
Posts: 0


Offline

PostPosted: Thu Apr 12, 2007 9:58 pm    Post subject: Reply with quote

Thrawn717 wrote:

cd..

cd..

cd..


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

What is the exact error message you are getting?
Back to top
View user's profile Send private message
Thrawn717
Just Arrived
Just Arrived


Joined: 28 Mar 2006
Posts: 0


Offline

PostPosted: Thu Apr 12, 2007 10:07 pm    Post subject: Reply with quote

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"

if exist "c:\DataStaff1\VersionNumber1.1.7.txt" del "C:\DataStaff1\VersionNumber1.1.7.txt"
Back to top
View user's profile Send private message MSN Messenger
stimpy99
Just Arrived
Just Arrived


Joined: 11 Sep 2005
Posts: 0


Offline

PostPosted: Thu Apr 12, 2007 10:14 pm    Post subject: Reply with quote

As I said before - the cd .. will work from the directory where the login script is. If you want to go to the root dir of c: then use c: then a cd \ - that could be why it is failing

But then in your batch file you are using fully qualified paths: f not exist "c:\DataStaff1\VersionNumber1.1.8.txt" copy/y "z:\Naomi\DataStaff.mdb" so you do not need to do it.
Back to top
View user's profile Send private message
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Databases All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Community Area

Log in | Register