Windows 8.1 Calculator Install Script


  1. Posts : 6
    Windows 10
       #1

    Windows 8.1 Calculator Install Script


    Made a little script to install the old Win32 style calculator from Windows 8.1. Maybe someone will find it useful. :)

    While the batch file does not overwrite any system files, it does change the keyboard calculator button to open the 8.1 app (comment out the "reg add" line to disable that).

    See attachment for calculator executables.

    Code:
    cd /d %~dp0
    
    set MUI64="%SystemRoot%\System32\en-US\calc32.exe.mui"
    set MUI32="%SystemRoot%\SysWOW64\en-US\calc32.exe.mui"
    set CALC64="%SystemRoot%\System32\calc32.exe"
    set CALC32="%SystemRoot%\SysWOW64\calc32.exe"
    
    copy calc32.exe.mui %MUI64%
    copy calc32.exe.mui %MUI32%
    copy calc32_x64.exe %CALC64%
    copy calc32_x32.exe %CALC32%
    
    reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AppKey\18 /v ShellExecute /t REG_SZ /d calc32.exe /f
    
    set SCRIPT="%temp%\%RANDOM%.vbs"
    echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
    echo sLinkFile = "%SystemRoot%\..\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\Calculator (Classic).lnk" >> %SCRIPT%
    echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
    echo oLink.TargetPath = "%windir%\system32\calc32.exe" >> %SCRIPT%
    echo oLink.WorkingDirectory = "" >> %SCRIPT%
    echo oLink.Description = "Performs basic arithmetic tasks with an on-screen calculator." >> %SCRIPT%
    echo oLink.IconLocation = "%windir%\system32\calc32.exe" >> %SCRIPT%
    echo oLink.Save >> %SCRIPT%
    cscript /nologo %SCRIPT%
    del %SCRIPT%
    
    icacls "%SystemRoot%\..\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\Calculator (Classic).lnk" /setowner "NT AUTHORITY\SYSTEM"
    icacls %MUI64% /grant "ALL APPLICATION PACKAGES:(RX)"
    icacls %MUI64% /grant "BUILTIN\Users:(RX)"
    icacls %MUI64% /grant "NT AUTHORITY\SYSTEM:(RX)"
    icacls %MUI64% /grant "BUILTIN\Administrators:(RX)"
    icacls %MUI64% /grant "NT SERVICE\TrustedInstaller:(F)"
    icacls %MUI64% /setowner "NT SERVICE\TrustedInstaller"
    icacls %MUI64% /inheritance:r
    icacls %MUI32% /grant "ALL APPLICATION PACKAGES:(RX)"
    icacls %MUI32% /grant "BUILTIN\Users:(RX)"
    icacls %MUI32% /grant "NT AUTHORITY\SYSTEM:(RX)"
    icacls %MUI32% /grant "BUILTIN\Administrators:(RX)"
    icacls %MUI32% /grant "NT SERVICE\TrustedInstaller:(F)"
    icacls %MUI32% /setowner "NT SERVICE\TrustedInstaller"
    icacls %MUI32% /inheritance:r
    icacls %CALC64% /grant "ALL APPLICATION PACKAGES:(RX)"
    icacls %CALC64% /grant "BUILTIN\Users:(RX)"
    icacls %CALC64% /grant "NT AUTHORITY\SYSTEM:(RX)"
    icacls %CALC64% /grant "BUILTIN\Administrators:(RX)"
    icacls %CALC64% /grant "NT SERVICE\TrustedInstaller:(F)"
    icacls %CALC64% /setowner "NT SERVICE\TrustedInstaller"
    icacls %CALC64% /inheritance:r
    icacls %CALC32% /grant "ALL APPLICATION PACKAGES:(RX)"
    icacls %CALC32% /grant "BUILTIN\Users:(RX)"
    icacls %CALC32% /grant "NT AUTHORITY\SYSTEM:(RX)"
    icacls %CALC32% /grant "BUILTIN\Administrators:(RX)"
    icacls %CALC32% /grant "NT SERVICE\TrustedInstaller:(F)"
    icacls %CALC32% /setowner "NT SERVICE\TrustedInstaller"
    icacls %CALC32% /inheritance:r
    Windows 8.1 Calculator Install Script Attached Files
      My Computer


  2. Posts : 201
    Kernel 4.x.x
       #2

    Ah, good ole calc.

    In return of your kind gesture, I leave you with this.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:34.
Find Us




Windows 10 Forums