[windows2000] Re: delete multiple profiles

  • From: Spriggs Jon <Jon.Spriggs@xxxxxxxxxxxxxx>
  • To: windows2000@xxxxxxxxxxxxx
  • Date: Thu, 12 May 2005 14:10:16 +0100

Try this on your test rig. You might be worth copying off the default user
first!
 
Also, this will remove all profiles from *ALL* servers.
 
@echo off
 
set DoDomain=MySchool
set DoProfilePath=c$\Documents and Settings
set DoNotUseServers=DC01,TS01,TS03
 
If "%1"=="" Net View /domain:%DoDomain% | find "\\" > %temp%\MachineList.txt
If Not "%1"=="" Net View /domin:%DoDomain% | find /i "%1" >
%temp%\MachineList.TXT
 
 
REM What you could do here is remove your DC's and Terminal Servers with
lines as follows
for /F "UseBackQ" %%s in (`echo %DoNotUseServers%`) do Call :StripServers
%%s
 
for /F %%m in (MachineList.txt) Do rmdir /s /q %%m\%DoProfilePath%\*
 
Goto End
 
:StripServers
find /v /i "%1" %temp%\MachineList.txt > %temp%\NewMachineList.txt
del %temp%\MachineList.txt
ren %temp%\NewMachineList.txt %temp%\MachineList.txt
 
:End
 
Jon Spriggs 
-- 
The presence of a "Fujitsu" address does not imply or assume that Fujitsu
Services, Fujitsu or any other company containing the Fujitsu name uses or
endorses this product. This email is purely a personal opinion.

-----Original Message-----
From: Herchenbach, Jim [mailto:jherchenbach@xxxxxxxxxx] 
Sent: 12 May 2005 13:41
To: windows2000@xxxxxxxxxxxxx
Subject: [windows2000] delete multiple profiles


I help out at our local school and every year we go through and delete all
the profiles off each networked machine one at a time.  Can this be
automated or can multiple profiles be deleted all at once?  batch file or
command line?  Windows 2000 and Xp pro machines on windows 2000 server
network.
 
JIM HERCHENBACH
RVW Inc.
 
 


Other related posts: