No longer broken
This commit is contained in:
@ -39,17 +39,31 @@ set "Path=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\Wbem;%SystemRoot%\Sysnat
|
||||
:: Check LF line ending
|
||||
|
||||
pushd "%~dp0"
|
||||
>nul findstr /rxc:".*" "%~nx0"
|
||||
if not %errorlevel%==0 (
|
||||
>nul findstr /v "$" "%~nx0" && (
|
||||
echo:
|
||||
echo Error: Script either has LF line ending issue, or it failed to read itself.
|
||||
echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
|
||||
echo:
|
||||
ping 127.0.0.1 -n 6 > nul
|
||||
ping 127.0.0.1 -n 6 >nul
|
||||
popd
|
||||
exit /b
|
||||
)
|
||||
popd
|
||||
|
||||
set ohook=
|
||||
for %%# in (15 16) do (
|
||||
for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do (
|
||||
if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" set ohook=1
|
||||
)
|
||||
)
|
||||
|
||||
for %%# in (System SystemX86) do (
|
||||
for %%G in ("Office 15" "Office") do (
|
||||
for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do (
|
||||
if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" set ohook=1
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
set "_bit=64"
|
||||
set "_wow=1"
|
||||
if /i "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" set "_wow=0"&set "_bit=32"
|
||||
@ -78,6 +92,17 @@ del /f /q slmgr.vbs >nul 2>&1
|
||||
popd
|
||||
echo %line3%
|
||||
|
||||
if defined ohook (
|
||||
echo.
|
||||
echo.
|
||||
echo %line2%
|
||||
echo *** Office Ohook Activation Status ***
|
||||
echo %line2%
|
||||
echo.
|
||||
powershell "write-host -back 'Black' -fore 'Yellow' 'Ohook for permanent Office activation is installed.'; write-host -back 'Black' -fore 'Yellow' 'You can ignore below Office activation status.'"
|
||||
echo.
|
||||
)
|
||||
|
||||
:casVo16
|
||||
set office=
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\Office\16.0\Common\InstallRoot /v Path" 2^>nul') do (set "office=%%b")
|
||||
@ -230,4 +255,5 @@ cscript //nologo "!office!\ospp.vbs" /dstatus
|
||||
echo.
|
||||
echo Press any key to exit.
|
||||
pause >nul
|
||||
exit /b
|
||||
exit /b
|
||||
:: Leave empty line below
|
||||
|
Reference in New Issue
Block a user