|
Answer» I have 200 students logging into around 30 PC's and every time one logs in XP creates a copy of the users folder in documents and settings, after a week or so the older machines are full up so I need a small batch file or script to SILENTLY remove ALL folders in the D&S folder EXCEPT admin and "all users"
Anyone have any idea's? I could probably figure it out in shell scripting but I am a bit stumped in Windows
Please HELP as it would save a LOT of time sat deleting stuff manually every week
Many Thanks in advance to the Champion who helps me outThis is actually easier in batch than say VBScript due to the hidden directories.
Code: [Select]@echo off cd /d c:\documents and settings for /f "delims=" %%i in ('dir /a:-hd /b') do ( if /i not %%i==Administrator if /i not "%%i"=="All Users" rd %%i /s /q )
Hope this helps. 8-)
PS. I suspect you want to keep the Default User, LocalService, and NetworkService.Thanks, gonna go modify it a bit and give it a whirl, hopefully I can SET up a telnet on all the PC's with this in the system folder to save me getting off my lazy *censored* like I can with all the Mac's on the network
Will report BACK and thanks againwhat is that /d switch? what it do?The /d switch on a cd command allows you to change both the drive and the directory in one command. Not SURE how many Windows versions support this switch.
8-)
|