Link to home
Create AccountLog in
Avatar of timnjohnson
timnjohnsonFlag for United States of America

asked on

A script to delete user Profile after Logoff in XP

Hi ALL,
Background:  These workstatiions are not on the Domain:
In our Campus students have individual accounts and each time they logoff a profile is created under
C:\Documents and Settings\user1.  So, what I want is a vbscript or batch to delete each user account after logoff.  That means regardless of how many users logon in a given day, no profile is saved under C:\Documents and Settings.  Again these are stand alone desktops but deleting the profile everyday is killing me.  I need automate the process instead of maual mode.  
Any ideas suggestions are greatly appreciated.

Avatar of slam69
slam69
Flag of United Kingdom of Great Britain and Northern Ireland image

IM confused? if they have individual accountsbut arent on teh domain how do they log if there is no credentials to them to log on to?

however delprof can be used for this

Delprof.exe /I /Q /C:\\pc1 /D:1

will delete all profiles used that day

http://windowsitpro.com/articles/print.cfm?articleid=48249
store a batch file on every users machine in c:\computers text with one line for their computer name wihtin teh text file

For /f %%a in (c:\computers.txt) Do Delprof.exe /I /Q /C:\\%%a /D:1

then set a scheduled task to run the batch file at a set time every day
Any update?
Avatar of timnjohnson

ASKER


Is this how you do it?  Give me a little details.
/f %% in (C:\DIMCFICE0102256.txt) Delprof.exe /I /Q /C:\\%%a /D:1
Thanks,
thats how you do it, put that into a batch file, store the list of computers within the C:\DIMCFICE0102256.txt file as one machine per line and then run that batch file

open notepad
paste /f %% in (C:\DIMCFICE0102256.txt) Delprof.exe /I /Q /C:\\%%a /D:1
save the file as cleanupusers.bat
then just run that to do teh clean up

So, if I store the list of computers how are these computers be cleaned up?
I'm assuming this is not going in a login script?  Is yes i can understand adding a list of computers in the txt.  I am a little lost?
 
paste /f %% in (C:\DIMCFICE0102256.txt) Delprof.exe /I /Q /C:\\%%a /D:1
save the file as cleanupusers.bat
then just run that to do teh clean up
ASKER CERTIFIED SOLUTION
Avatar of slam69
slam69
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer

YES, vbscript we do a great deal.  Please get me one.
lol my mess up

 you dont even need a vb script you can just set a scheduled task to run the .bat file at say 7pm every evening
Any Update?