1.

Solve : Delete old profiles remotely from multiple PCs?

Answer»

I am wanting to delete old profiles that are older than 30 days remotely for multiple PCS (<100).

I have been messing around with MS delprof.exe. The command for the executable is:

C:\progra~1\windows~3\tools\delprof /Q /C:\\computername /D:30

/Q = quiet, no confirmation
/C = remote computer name
/D = number of days of inactivity

My QUESTION is how do I loop in a list of computer names to complete this task?

Thank you in advance!This solution makes use of a file (computer.txt) containing the computer names one to a line.

Code: [Select]@echo off
for /F %%i in (computer.txt) do (
C:\progra~1\windows~3\tools\delprof /Q /C:\\%%i /D:30
)

If the computer names contain SPACES or special characters, the batch script will need some minor adjustments.




Works like a charm! Thanks so much for the quick response! Awesome forum!



Discussion

No Comment Found