Does Windows offer a way to open the file/directory properties dialog through command line?
I found various rundll32.dll commands, but none of them offer this functionality. What would be the
Does Windows offer a way to open the file/directory properties dialog through command line?
I found various rundll32.dll commands, but none of them offer this functionality. What would be the
There is a utility called wmic in windows
wmic datafile where Name="F:\\abc.txt" get Description,Name,FileType
Hope it helps, Thnx in advance if not pls do comment below...
Indeed you can utilize Powershell for this. Powershell is able to create COM objects, which some Windows APIs are implemented as, in particular the Windows shell. The Powershell command would be something like this:
$shell = New-Object -COMObject Shell.Application
$shell.NameSpace($AbsolutePathToContainingFolder).ParseName($PathToFileInFolder).InvokeVerb("Properties")
Explaining the above:
Shell.Application object exposes Windows shell methods you need here, it's an object of a COM class$shell.NameSpace is the method that gets you a "namespace" API object corresponding to the folder containing the file, to use for further calls$AbsolutePathToContainingFolder denotes the full path to the folder containing the file you want to invoke the dialog onParseName is required to obtain a FolderItem object for the file$PathToFileInFolder is [relative] path to the file in questionInvokeVerb is the method that through invoking a well, verb, opens a the Properties dialogDocumentation of all the methods is available to you navigating through the Shell object documentation linked above.