i am trying to write a script that takes ownership of a file. i was sucessfull in finding a way to do this as a test:
strComputer = "."
Set objWMIService = _
GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set objShare = objWMIService.Get("Win32_Directory")
Set objOutParams = objWMIService.ExecMethod( _
"Win32_Directory.Name='C:\\temp'", "TakeOwnerShip")
so this works, now i want to be able to do this for a list of servers which i have read in before.
basically my issue is with the last line when i try and use a UNC path instead. any ideas on why?
strComputer = "."
Set objWMIService = _
GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set objShare = objWMIService.Get("Win32_Directory")
Set objOutParams = objWMIService.ExecMethod( _
"Win32_Directory.Name='C:\\temp'", "TakeOwnerShip")
so this works, now i want to be able to do this for a list of servers which i have read in before.
basically my issue is with the last line when i try and use a UNC path instead. any ideas on why?