diff --git a/#Readme.txt b/#Readme.txt index a018131..6291a36 100644 --- a/#Readme.txt +++ b/#Readme.txt @@ -1,5 +1,5 @@ - [ Englishize Cmd v1.6a ] + [ Englishize Cmd v1.7a ] http://wandersick.blogspot.com | wandersick@gmail.com @@ -57,22 +57,26 @@ [ Releases ] - v1.6a A quick fix to improve the last version. - v1.6 Fixed bug in some non-English localized versions of Windows + 1.7a A quick fix to patch the recently updated restore.bat which + launched incorrect batch script during elevation. + 1.7 Fixes non-stop prompting when run as standard user w/o UAC. + Added a note: it is normal to see 'not enough storage' error + 1.6a A quick fix to improve the last version. + 1.6 Fixed bug in some non-English localized versions of Windows where 'Administrators' group account is named something else. Thanks Markus (echalone). Confirmed working in Windows 8.1. - v1.5 Support for mui files under %systemroot%\syswow64. + 1.5 Support for mui files under %systemroot%\syswow64. Restorer now restores original permissions and ownership Confirmed working in Windows 8. Updated with new CLI tools. - v1.4a Fixed a significant bug of last version. _lang_codes.txt should + 1.4a Fixed a significant bug of last version. _lang_codes.txt should not have any 'en-XX' otherwise even English is disabled. - v1.4 Improved _lang_codes.txt so that all system languages are + 1.4 Improved _lang_codes.txt so that all system languages are supported. (Please report if your locale is not included) - v1.3 Now elevates automatically. Added check for Windows version. - v1.2 Documentation and coding improvements - v1.1 Added check for admin rights - v1.0 First public release + 1.3 Now elevates automatically. Added check for Windows version. + 1.2 Documentation and coding improvements + 1.1 Added check for admin rights + 1.0 First public release [ Suggestions ] diff --git a/englishize.bat b/englishize.bat index 984e6ed..f721603 100644 --- a/englishize.bat +++ b/englishize.bat @@ -11,6 +11,10 @@ for /f "usebackq tokens=3 skip=2" %%i in (`reg query "HKLM\SOFTWARE\Microsoft\Wi ) ) +:: UAC check +reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA | find /i "0x1" +if %errorlevel% EQU 0 set UACenabled=1 + :: detect if system has WSH disabled unsigned scripts :: if useWINSAFER = 1, the TrustPolicy below is ignored and use SRP for this option instead. So check if = 0. :: if TrustPolicy = 0, allow both signed and unsigned; if = 1, warn on unsigned; if = 2, disallow unsigned. @@ -36,16 +40,21 @@ if defined noWSH ( attrib >nul 2>&1 if "%errorlevel%"=="9009" set noAttrib=1 -:: detect for admin rights +:: detect admin rights if defined noAttrib goto :skipAdminCheck attrib -h "%windir%\system32" | find /i "system32" >nul 2>&1 if %errorlevel% EQU 0 ( - cscript //NoLogo ".\Data\_elevate.vbs" "%CD%\" "%CD%\englishize.bat" >nul 2>&1 - REM echo. - REM echo # ERROR: Admin rights required. - REM echo. - REM pause - goto :EOF + if "%UACenabled%" EQU "1" ( + REM only when UAC is enabled can this script be elevated. Otherwise, non-stop prompting will occur. + cscript //NoLogo ".\Data\_elevate.vbs" "%CD%\" "%CD%\englishize.bat" >nul 2>&1 + goto :EOF + ) else ( + echo. + echo ** WARNING: Script running without admin rights. Cannot continue. + echo. + pause + goto :EOF + ) ) :skipAdminCheck @@ -56,10 +65,10 @@ for /f "usebackq tokens=* delims=" %%i in (`cscript //NoLogo ".\Data\_determine_ cls -title Englishize Cmd v1.6a +title Englishize Cmd v1.7a echo. echo. -echo [ Englishize Cmd v1.6a ] +echo [ Englishize Cmd v1.7a ] echo. echo. echo # This script changes command line interface to English. @@ -116,4 +125,4 @@ echo # Completed. To restore, run restore.bat echo. echo Press any key to run test . . . pause >nul -start "" "%comspec%" /k "help&echo.&echo # Successful if the above is displayed in English.&echo.&pause" +start "" "%comspec%" /k "help&echo.&echo # Successful if the above is displayed in English.&echo.&echo # Note: It is normal if you see 'not enough storage' error.&echo.&pause" diff --git a/restore.bat b/restore.bat index 5ef6158..0d7f4db 100644 --- a/restore.bat +++ b/restore.bat @@ -11,6 +11,10 @@ for /f "usebackq tokens=3 skip=2" %%i in (`reg query "HKLM\SOFTWARE\Microsoft\Wi ) ) +:: UAC check +reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA | find /i "0x1" +if %errorlevel% EQU 0 set UACenabled=1 + :: detect if system has WSH disabled unsigned scripts :: if useWINSAFER = 1, the TrustPolicy below is ignored and use SRP for this option instead. So check if = 0. :: if TrustPolicy = 0, allow both signed and unsigned; if = 1, warn on unsigned; if = 2, disallow unsigned. @@ -36,16 +40,21 @@ if defined noWSH ( attrib >nul 2>&1 if "%errorlevel%"=="9009" set noAttrib=1 -:: detect for admin rights +:: detect admin rights if defined noAttrib goto :skipAdminCheck attrib -h "%windir%\system32" | find /i "system32" >nul 2>&1 if %errorlevel% EQU 0 ( - cscript //NoLogo ".\Data\_elevate.vbs" "%CD%\" "%CD%\restore.bat" >nul 2>&1 - REM echo. - REM echo # ERROR: Admin rights required. - REM echo. - REM pause - goto :EOF + if "%UACenabled%" EQU "1" ( + REM only when UAC is enabled can this script be elevated. Otherwise, non-stop prompting will occur. + cscript //NoLogo ".\Data\_elevate.vbs" "%CD%\" "%CD%\restore.bat" >nul 2>&1 + goto :EOF + ) else ( + echo. + echo ** WARNING: Script running without admin rights. Cannot continue. + echo. + pause + goto :EOF + ) ) :skipAdminCheck @@ -55,10 +64,10 @@ for /f "usebackq tokens=* delims=" %%i in (`cscript //NoLogo ".\Data\_determine_ cls -title Englishize Cmd v1.6a +title Englishize Cmd v1.7a echo. echo. -echo [ Englishize Cmd v1.6a ] +echo [ Englishize Cmd v1.7a ] echo. echo. echo # This script restores the command line interface back to original @@ -95,6 +104,6 @@ for /f "usebackq" %%i in ("_files_to_process.txt") do ( echo. echo # Completed. echo. -echo Press any key to run test . . . +echo Press any key to test . . . pause >nul -start "" "%comspec%" /k "help&echo.&echo # Successful if the above is displayed in the original language.&echo.&echo # Note it may not reflect now if the restorer was run elevated.&echo.&pause" +start "" "%comspec%" /k "help&echo.&echo # Successful if the above is displayed in the original language.&echo.&echo # Note 1: It may not reflect now if the restorer was run elevated.&echo.&echo # Note 2: It is normal if you see 'not enough storage' error.&echo.&pause"