Jump to content



Photo

Open Files Properties via Commandline

win7

  • Please log in to reply
1 reply to this topic

#1 brink668

brink668

    Neowinian

  • Joined: 12-September 07

Posted 24 June 2014 - 19:17

Does anyone know how to open up this screen via command prompt or maybe through AutoIT?

 

For an old application I need to get to this window and modify a setting per each machine. This has to be done under the user profile and needs to be open via the desktop gui interface cannot be done silently.

 

Just trying to get to this window as fast as possible.

 

"Right Click" on Exe then click "Properties"

 

66Dg4k5.png




#2 zhangm

zhangm

    Just bitter.

  • Tech Issues Solved: 23
  • Joined: 21-August 02

Posted 24 June 2014 - 20:25

This Powershell function appears to accomplish what you've described.

 

function Show-Properties {
param(
[Parameter(ValueFromPipelineByPropertyName=$true)]
[Alias('LinkPath')]
[Alias('FileName')]

$Path
)
begin {
  $shell = New-Object -ComObject Shell.Application
}

process {
  $parent = Split-Path $Path
  $child = Split-Path $Path -Leaf

  $folder = $shell.NameSpace($parent)
  $file = $folder.ParseName($child)
  $file.InvokeVerb('Properties')
}
}

http://powershell.co...dia/p/7746.aspx