Thursday, 7 March 2019

Opening a filesystem object properties window from powershell?


Is it possible to open the properties dialog of a file or folder from powershell?


And if so, how would I do it?



Answer



$o = new-object -com Shell.Application
$folder = $o.NameSpace("C:\path\to\file")
$file = $folder.ParseName("filename.txt")

# Folder:
$folder.Self.InvokeVerb("Properties")

# File:
$file.InvokeVerb("Properties")

Further reading


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...