3

I just upgraded from Windows 8.1 to Windows 10 Pro, and I'm really enjoying the new calculator application, except for the fact that it opens a new instance every time I use my keyboard's calculator key.

Is there a way to force it to be a single-instance application like the calculator in Windows 8.1 was without forcing me to use a different application?

holiveira
  • 1,351

3 Answers3

3

Use AHK. Map your calculator key to the following script (this one is mapped to Win + Z):

#z::
IfWinExist Calculator
WinActivate
else
Run calculator://
return
SuperMrBlob
  • 131
  • 4
  • Thx, I was going crazy with Windows 10 opening multiple instances of the calculator whenever I use the calculator button on my Microsoft keyboard. Since I am already using AHK for other things, this was the most simple solution for me. – fritzmg Aug 16 '16 at 17:45
  • Weirdly though, this isn't working on all my Windows 10 systems. If I ran the complied version of the script on another computer, it opens new instances every time. Do you know why this would happen? – fritzmg Aug 17 '16 at 13:52
  • Never mind, on one system (even though both are English) the calculator was English, on another the calculator was German - thus it was called Rechner instead of Calculator and I had to change the script accordingly. – fritzmg Aug 17 '16 at 14:03
  • Good to hear it's working! – SuperMrBlob Aug 18 '16 at 09:00
0

Just start the app and pin it to the Taskbar. Then you start it by clicking or by using shortcuts Win+1, Win+2 etc. Both clicking and using shortcut executes only one instance of the app. If the instance is already running and you repeat the shortcut you only call up the focus of the app.

If you ever decide to start another instance, just Right-click on the icon in Taskbar and click on the app name. In my opinion, using these shortcuts raises the work efficiency and lowers mental exhaustion distinctively.

screenshot of the calculator app

Markus Meyer
  • 1,614
0

A method that doesn't involve AHK:

I went with another method that involved putting a script somewhere visible to %PATH% and editing the registry to call the script.

That registry edit is as follows:

Set key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AppKey\18\ShellExecute
to value "scriptname.wsf" which is whatever you choose to name the script file.

The script I used was:

<package>
   <job id="vbs">
      <script language="VBScript">
         Set WshShell = WScript.CreateObject ("WScript.Shell")
         Set colProcessList = GetObject("Winmgmts:").ExecQuery ("Select * from Win32_Process")
     For Each objProcess in colProcessList
     If objProcess.name = &quot;Calculator.exe&quot; then
     vFound = True
     End if
     Next

     If vFound then
     WshShell.AppActivate &quot;Calculator&quot;
     Else
     WshShell.run &quot;calc.exe&quot;, 5, false
     End If
  &lt;/script&gt;

</job> </package>

This was based on an answer to the Stack Overflow question How to run single instance of calculator (calc.exe) in Windows.

But the script they wrote didn't work in Windows 10, so I combined some bits from other sources to make mine, which does. A miracle, since I know nothing about VBScript, but it's a functioning option, if you don't want to run AHK.