Link to home
Start Free TrialLog in
Avatar of dbrs_helpdesk
dbrs_helpdesk

asked on

delete profiles on remote computers

Hello,

I need a VB script that will delete profiles on 10 remote computeres within our network.  The only profile that needs to stay is the administrator profile.  These computers are in our training room.  I need to run this script from any PC that will interact with the remote PC's.
Avatar of dbrs_helpdesk
dbrs_helpdesk

ASKER

I found this script but it does not work

@echo off
for /f "tokens=*" %%a in ('dir c:\docume~1 /b /ad') do call :process "%%a"
goto :eof
 
:process
if [%1]==["Administrator"] goto :eof
if [%1]==["All Users"] goto :eof
if [%1]==["Default User"] goto :eof
if [%1]==["LocalService"] goto :eof
if [%1]==["NetworkService"] goto :eof
cd\docume~1
echo. About to remove profile %1
pause
rmdir %1 /s /q

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of zoofan
zoofan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Can you use it in a batch file to run on about 350 pcs?