Take ownership of multiple files
Posted on 2006-11-09
I have the following script that will take ownership of 1 folder, what I want to do is to have this take ownership of a large amount of folders at once by either pulling the folder name from a text file or just listing it in the script. So I have a directory called owner and say I have 10 folders under that called 1 through 10.. is this possible?
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFolders = objWMIService.ExecQuery _
("Select * From Win32_Directory Where Name = 'C:\\Owner'")
For Each objFolder in colFolders