|
|
- Powershell -nop -c "$n=0;$maxP=260;$lib='c:\Windows\System32\shell32.dll';$buf=New-Object Text.StringBuilder($lib,$maxP);Add-Type 'using System;using System.Runtime.InteropServices;public class p{[DllImport(\"shell32.dll\",EntryPoint=\"PickIconDlg\",CharSet=CharSet.Unicode)]public static extern int picker(IntPtr h,[MarshalAs(UnmanagedType.LPWStr)]string path,uint maxPath,ref int index);}';$r=[p]::picker([IntPtr]::Zero,$buf,$maxP,[ref]$n);if($r -eq 1){Write-Host \"图标库文件: $($buf.ToString())`n图标索引号: $n\"}else{Write-Host '用户选择了取消!'}"
复制代码
PS 命令一行过,,, |
|