Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @set @v=1 /* &echo off &title Calc single instance from media key
- set "calckey=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AppKey\18"
- reg add "%calckey%" /v ShellExecute /d "wscript.exe /e:JScript \"%~f0\"" /f &exit */
- calc=GetObject("winmgmts://./root/CIMv2").ExecQuery("Select * from Win32_Process WHERE Name LIKE 'Calculator.exe'")
- shell=WSH.CreateObject("WScript.Shell"); if (calc.Count>0) shell.AppActivate("Calculator"); else shell.Run('calc',1,'False');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement