没有11不知道在11上有没有效- #@&cls&powershell -sta "$a='%~0';type %~s0|out-string|iex"&exit
- $out="$Home\Desktop" #图片路径
- $p="$Home\Desktop\$($a.split('\/')[-1])`.lnk"
- if(test-path $p){
- Add-Type -AssemblyName System.Windows.Forms
- [System.Windows.Forms.SendKeys]::Sendwait("{PRTSC}")
- $f='{0:yyyymmdd_HHmmss}.png' -f (get-date)
- ([Windows.Forms.Clipboard]::GetImage()).save($f)
- while(!(test-path $f)){sleep -m 300}
- start mspaint -arg "/p $f"
- }else{
- $Wsh = New-Object -com WScript.Shell
- $Shortcut = $Wsh.CreateShortcut($p)
- $Shortcut.TargetPath="$a"
- $Shortcut.WorkingDirectory="$out"
- $Shortcut.Hotkey='F7'
- $Shortcut.WindowStyle=7
- $Shortcut.Save()
- }
复制代码
|