Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem REPLACE-CALC.BAT
- rem
- rem Replace the default Windows calculator (calc.exe) with
- rem Moffset Freecalc (http://www.moffsoft.com/freecalc.htm)
- rem
- rem Windows 10's calculator has a terrible UI. Moffset's is free,
- rem and while not beautiful, is much more usable.
- rem
- rem The batch commands below use debbugger routines in the registry as noted here:
- rem
- rem https://stackoverflow.com/questions/2984846/set-image-file-execution-options-will-always-open-the-named-exe-file-as-defaul
- rem
- rem Note that a different calculator could easily be used instead by changing
- rem the "\Moffset Freecalc\MoffFreeCalc.exe" below to something else.
- rem
- rem The Image File Execution debugger technique used here could be used to
- rem replace other Windows built-in apps as well. (E.g., Notepad++
- rem replacing notepad.exe.)
- rem
- rem by Matthew Borcherding
- rem matt@borchtech.com
- rem updated 10-06-2018
- setlocal
- rem
- rem Check if on a 64-bit OS. Setup program files directory accordingly.
- rem
- set pf=%programfiles%
- if %PROCESSOR_ARCHITECTURE%==AMD64 set pf=%programfiles(x86)%
- rem
- rem The %pf% variable is now set to the "%programfiles%" directory
- rem on 32-bit systems, and the "%programfiles(x86)%" directory
- rem on 64-bit systems,
- rem
- rem
- rem Now double-check that Moffset FreeCalc is installed.
- rem No point to do this if it's not already installed.
- rem
- if not exist "%pf%\Moffsoft FreeCalc\MoffFreeCalc.exe" goto end
- rem
- rem OK, Freecalc is installed. Let's set the proper registry keys.
- rem
- reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\calc.exe" /v "Debugger" /t REG_SZ /d "%pf%\Moffsoft FreeCalc\MoffFreeCalc.exe" /f
- :end
- rem
- rem Done!
- rem
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement