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
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
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
  echo Requesting administrative privileges...
  goto UACPrompt
) else ( goto gotAdmin )
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
exit /B
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 %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 /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

Leave a Comment


E-Mail :

Subscribe :
Website :

Comments :