does anyone know a powerscript or vbscript that will delete folders for specific userids instead of doing it manually one at a time

1 Comment   [ - ] Hide Comment


  • There is a very nice program for this task called delprof2
Please log in to comment

Answer this question or Comment on this question for clarity



There are at least...ooooh, I don't know...a quadzillion scripts around which will search a folder and its sub-folders for a specific file and/or folder. The fact that the folder is named as a user ID is pretty much irrelevant - it's still just a folder.

Answered 09/07/2013 by: VBScab
Red Belt

Please log in to comment

VB script:

On error resume next

Set fso = createobject("scripting.filesystemobject")

Set wshell = wscript.createobject("wscript.shell")

Set SysDrv = wshell.ExpandEnvironmentStrings("%SystemDrive%")


Set Folder = fso.GetFolder(SysDrv & "\Users")

Set fc = folder.subfolders

For each userprof in fc

fso.deletefile usesrprof & "\<path of the file needs to deleted>"



Answered 09/11/2013 by: rvprasad
Brown Belt

Please log in to comment