Install Winhlp32 (32bit Winhelp) on Windows 10

By dose | February 18, 2021
Under: Uncategorized

As I recently got asked on how to install WinHlp32.exe on Windows 10, I once wrote a little script to automate the task that I share here, as Microsoft fails to provide an installer for it on Windows 10.

Just copy the following lines into a file called install_winhelp.cmd and then execute it, it should download and install winhlp32.exe automatically:

@echo off
setlocal
echo Detecting language...
set LANG=%1
if "%1"=="" for /f "delims=" %%a in ('powershell.exe -ExecutionPolicy ByPass -Command "$PSUICulture"') DO set "LANG=%%a"
if "%LANG%"=="" set LANG=de-de
 
rem Ensure that we are run from 64bit prompt
if "%ProgramFiles(x86)%" == "" goto StartExec
if not exist %SystemRoot%\Sysnative\cmd.exe goto StartExec
%SystemRoot%\Sysnative\cmd.exe /C "%~f0" %*
exit /b
:StartExec
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
  echo Requesting administrative privileges...
  goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
 
set ARCH=amd64
reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | Find /i "x86" >nul
if not errorlevel 1 set ARCH=x86
 
echo Downloading Winhelp, using language %LANG% for arch %ARCH%...
bitsadmin /transfer Windows8.1-KB917607-x64.msu /download /priority normal https://download.microsoft.com/download/A/5/6/A5651A53-2487-43C6-835A-744EB9C72579/Windows8.1-KB917607-x64.msu %CD%\Windows8.1-KB917607-x64.msu
if not exist Windows8.1-KB917607-x64.msu goto fini
 
md ContentMSU
expand Windows8.1-KB917607-x64.msu /F:* .\ContentMSU
 
cd ContentMSU
md ContentCAB
expand Windows8.1-KB917607-x64.cab /F:* .\ContentCAB
 
cd ContentCAB
cd %ARCH%*winhstb*%LANG%*
if not exist winhlp32.exe.mui (
  echo winhlp32.exe.mui does not exist in requested langauge
  goto fini
)
takeown /f "%SystemRoot%\%LANG%\winhlp32.exe.mui"
icacls "%SystemRoot%\%LANG%\winhlp32.exe.mui" /grant "%UserName%":F
ren %SystemRoot%\%LANG%\winhlp32.exe.mui winhlp32.exe.mui.w10
copy /y winhlp32.exe.mui %SystemRoot%\%LANG%\winhlp32.exe.mui 
cd ..
cd %ARCH%*winhstb*none*
if not exist winhlp32.exe (
  echo winhlp32.exe does not exist ??
  goto fini
)
takeown /f "%SystemRoot%\winhlp32.exe"
icacls "%SystemRoot%\winhlp32.exe" /grant "%UserName%":F
ren %SystemRoot%\winhlp32.exe winhlp32.exe.w10
copy /y winhlp32.exe %SystemRoot%\winhlp32.exe
cd ..\..\..
rmdir /s /q  ContentMSU
echo Done
 
:fini
endlocal
pause

Leave a Comment

Name:

E-Mail :

Subscribe :
Website :

Comments :