Log inRegister

Single instance calculator

Every time you press the Calc button on your keyboard, a new instance is opened. You'd rather have one instance, so switching to the existing instance if calc.exe is already active.

Solution: https://stackoverflow.com/questions/36178745/how-to-run-single-instance-of-calculator-calc-exe-in-windows

Create .wsf script (Windows Script File):
  <job id="js">
   <script languange="JScript">
     var WshShell = WScript.CreateObject("WScript.Shell");
     var ret = WshShell.AppActivate("Calculator");
     if (ret==false)

I save it in my tools directory ("E:\Tools\CalcSingleInstance\SingleInstanceCalc.wsf").

Now link the hardware key 'Calc' on your keyboard to that script:
  • regedit
  • go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AppKey\18
  • create a String Value:
    • Name: ShellExecute
    • Data: "E:\Tools\CalcSingleInstance\SingleInstanceCalc.wsf"
Now, when you press the dedicated keyboard key, the .wsf script is launched which checks whether the calc.exe is already running or not.

If you still want two instances, simply execute calc.exe.

If you want to know more about the dedicated keyboard keys, see topic Win10DedicatedKeys.
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This page was cached on 15 May 2023 - 22:41.