Viewing the Owner of a File

Q. How can I use a VBScript to view the owner of a file?

A. To view the owner of a file, you can use Windows Management Instrumentation (WMI). The following script displays the owner of a local or remote file.

If Wscript.Arguments.Count 
This is shown in action below:

D:\Temp>cscript getowner.vbs d:\temp\boot.wim .
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

Owner: SAVILLTECH\john
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish