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   [ + ] Show Comment

Comments

  • There is a very nice program for this task called delprof2
    http://helgeklein.com/free-tools/delprof2-user-profile-deletion-tool
Please log in to comment

Answers

0

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
0

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>"

Next

 

Answered 09/11/2013 by: rvprasad
Fourth Degree Green Belt

Please log in to comment
Answer this question or Comment on this question for clarity