A
Alan
How can I find out who is the "owner" of a file in XP
Home? Thanks.
Home? Thanks.
Alan said:Thanks Roger - that solved the problem. Is there a non-
safe mode solution for XP Home to save me booting to safe
mode?
{Win32_LogicalFileSecuritySetting='" & sFile _-----Original Message-----
Hi
Try this:
Create a file called GetOwner.vbs containing the script below and
create a shortcut to it in the SendTo folder (or just put the file
itself in the SendTo folder, but then you will see the .vbs extension,
at least if you have set Explorer to show file extensions).
This way, you can select one or several files in Explorer, right click
on them and use the SendTo selection GetOwner. If you want to get the
result into the clipboard, just press Ctrl+C on the dialog box.
To open the SendTo folder, run this from the Start\Run menu (include
the quotes!):
"%USERPROFILE%\SendTo"
GetOwner.vbs:
'--------------------8<----------------------
Set oArgs = WScript.Arguments
If oArgs.Count = 0 Then
MsgBox "Error: You need to supply one or more file name (s) " _
& "as input parameter(s)!", vbSystemModal, "GetOwner"
Wscript.Quit
End If
sStr = "<file>: <owner>" & vbCrLf
For i = 0 To oArgs.Count - 1
sStr = sStr & oArgs(i) & ": " _
& GetOwner(oArgs(i)) & vbCrLf
Next
WScript.Echo sStr
If InStr(1, WScript.FullName, "cscript.exe", vbTextCompare) > 0 Then
MsgBox "Finished", vbSystemModal, "GetOwner"
End If
Function GetOwner(sFile)
sComputer = "."
Set oWMI = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & sComputer & "\root\cimv2")
On Error Resume Next
Set oCollection = oWMI.ExecQuery _
("ASSOCIATORS OF