Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch file on logoff? Possible to do?

Status
Not open for further replies.

DanIT

MIS
May 11, 2001
67
CA
I need to replace a .ini file on a Win2K workstation. Here is the scenario:

I need to replace a .ini file on logon to connect the users to a test machine. On logoff, I need to put the correct on back in place.


User will log in locally to the machine, not to the domain. We cannot log the users on to the domain. All users will use the same login credentials, and the same profile name on all machines

I can do the first replace by putting the batch file in that profiles startup folder. But I'm at a loss how to restore the original one on logoff. I don't want to rely on the user to remember.

Any ideas? Thanks.

Dan
 
Dan

How about adding an entry for the RunOnce key in the registry. Add it to the script that runs on startup using the "reg.exe" tool (which ships as part of the Windows 2000 Support Tools). It will then make it that the next time the user logs on, it will run whatever you put into the RunOnce key of the registry.

You can put a batch file to change the .ini when the user logs on. Since it is only run once the next time the user logs on it won't be run again.

Another thing to do is to put in the startup folder a batch file or script that will check to see if the correct .ini file is there and if not, it will change it back. You run that before you run your batch file to change it and then the next time the user logs on the file will automaticaly be changed back

tyro

Here are some links to information about the reg.exe tool:

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top