简体   繁体   中英

Call windows explorer “rotate clockwise” operation from a C# application

Does anyone know how to find out what is actually being called here? I'd like to automate this with PowerShell or C#.

在此处输入图片说明

I don't know what's actually called by those context menu items, but you can invoke these verbs via the Shell.Application object:

$path = 'C:\path\to\your.jpg'

$folder = Split-Path -Parent $path
$file   = Split-Path -Leaf $path

$app = New-Object -COM 'Shell.Application'

$app.NameSpace($folder).ParseName($file).Verbs() |
  Where-Object { $_.Name -eq 'Rotate cloc&kwise' } |
  ForEach-Object { $_.DoIt() }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM