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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a Logoff folder run a batch file when a user Logoff ?

Status
Not open for further replies.

maupiti

Programmer
Oct 27, 2003
240
US
Windows 2000 and Windows XP.

Is there a Logoff folder run a batch file when a user Logoff just as there is a Startup folder that run a batch file when a user Logon ?

I Windows 2000 and Windows XP I have a batch file that map a network drive regardless of which users logon and regardless of whether the PC is a workgroup or a domain, I put the batch file in the Startup folder and the path is shown below. This works.

C:\Documents and Settings\All Users\Start Menu\Programs\Startup

==============================================

1) How do I have a batch file that run when a user logoff regardless of which user logon to the PC and regardless of whether the PC is a workgroup or a domain. Is there some kind of say Logoff folder ?
 
I dont believe you can do this unless the computer is in a domain and you have it assigned to an OU. If the computer is in a domain this is very easy. Its in the user config portion of the Group Policy. what exactly are you trying to do with this logoff script?
 
Hi rye8261.

The logoff script simply unmapped a mapped network drive, and perhaps performed a few other simple tasks.

==================

logoff.bat
net use /delete g:

==================

Also. the computer I am using is a Windows 2000 Professional.
Start --> Run --> type in mmc and press ENTER
Under ]
Local Computer Policy
User Configuration
Windows Setting
I can put the file in the Logoff script folder and
this would work. The computer is a workgroup. It
is not in the domain but it still works.
C:\WINNT\system32\GroupPolicy\User\Scripts\Logoff
So I guess it works even though a computer is
not part of a domain or OU.
 
if all you want to do is un-map all the mapped drives. put this before you map the drives in your login script.

net use * /del /y

it will un-map all of your mapped drives and then you dont have to use a logoff script.

hope this helps some.
 
When creating the network shares in the batch file use the /PERSISTENT:NO switch. This way windows will delete them automatically when the user logs out.

Denny

--Anything is possible. All it takes is a little research. (Me)
 
To rye8261, mrdenny, GuyThomas.
Thank you gentlemen for helping.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top