- Joined
- Jan 24, 2006
- Location
- South Dakota
so I have a batch script that deletes all the relevent users off a large amount of computers, the problem is that the home folder is not removed.
This would not be a problem if windows just over-wrote the current folders but it doesnt. It leaves a big steaming pile behind.
I used the rmdir command with the /s /q switches to delete them in the batch file, the problem is that every once in a while the bat file doesnt delete a user for some silly reason. So once in a while we end up with a machine that has
bob
jim
sam
sam.d102.home
or some such silly thing, even with the rmdir command.
I have been googling to find out if net user will remove the associated home dir but I haven't come up with anything.
Anyone know a switch for netuser that will get rid of junk folders?
The next time I run my script the problem just compounds (mostly because I am hard coding the script... i.e.
)
so if the folder is same.d102.home I end up with 2 sam.d1xx.home folders instead of getting rid of everything
This would not be a problem if windows just over-wrote the current folders but it doesnt. It leaves a big steaming pile behind.
I used the rmdir command with the /s /q switches to delete them in the batch file, the problem is that every once in a while the bat file doesnt delete a user for some silly reason. So once in a while we end up with a machine that has
bob
jim
sam
sam.d102.home
or some such silly thing, even with the rmdir command.
I have been googling to find out if net user will remove the associated home dir but I haven't come up with anything.
Anyone know a switch for netuser that will get rid of junk folders?
The next time I run my script the problem just compounds (mostly because I am hard coding the script... i.e.
Code:
rmdir c:\doc\sam /s /q
so if the folder is same.d102.home I end up with 2 sam.d1xx.home folders instead of getting rid of everything