Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
wandersick authored Oct 23, 2017
1 parent 1b5299a commit 9d6b837
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 35 deletions.
63 changes: 44 additions & 19 deletions #Readme.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@

[ Englishize Cmd v1.2 ]
[ Englishize Cmd v1.3 ]

http://wandersick.blogspot.com | wandersick@gmail.com

[ What? ]

# Change non-English CMD interface to English in Windows 7/Vista
. Toggles between English and non-English for most Windows commands.

. For English system admins who manages Windows PCs of other languages.

. No need to log off; settings are appled immediately.

. Comes with a restorer too. Apply or restore is as simple as a click.

. Better character compatibility than changing DOS codepage.

. Most languages and executables are supported. Customizable.

. Administrator rights are required. It asks for rights to elevates itself.
Does not elevate over network mapped drives however.

# For the full story, read the article:
http://wandersick.blogspot.com/p/change-non-english-command-line.html
. Windows Vista/7 or later only.

[ How-to ]
[ Instructions ]

1. "Englishize.bat" for changing command line tools from non-English to
English. (Requires admin rights)
English.

2. "Restore.bat" to restore everything back to original language. (Requires
admin rights)
2. "Restore.bat" to restore everything back to original language.

3. "_lang_codes.txt" is a modifiable list containing all non-English language
codes. It includes most languages but in case your language is not there,
Expand All @@ -26,18 +37,32 @@
executables that will be affected in the change. All commands in Windows
Vista and 7 should be covered (although it contains much more commands
than there actually are, it doesn't matter because it has no effect on
commands that don't exist.) If you decide some commands are better left
localized rather than being changed to English, remove them from this list
before running "Englishize.bat". Also, although the list covers command-
line executables, you can add GUI -- Graphical User Interface - programs
such as Paint - mspaint.exe and lots of others to "_files_to_process.txt".
There is a limitation here though. Windows comes with both English and
non-English .mui files for command-line programs only; by default .mui for
GUI programs don't exist in en-US folder until users install the English
MUI through Windows Update) or Vistalizator (for non-Ultimate/Enterprise
Windows users).
commands that don't exist.)

If you decide some commands are better left localized rather than being
changed to English, remove them from the list before running "Englishize.
bat".

Also, although the list covers command-line executables, you can add GUI
-- Graphical User Interface - programs such as Paint - mspaint.exe and
lots of others to "_files_to_process.txt". There is a limitation here
though. Windows comes with both English and non-English .mui files for
command-line programs only; by default .mui for GUI programs don't exist
in en-US folder until users install the English MUI through Windows
Update) or Vistalizator (for non-Ultimate/Enterprise Windows users).

[ Video Demo ]

http://wandersick.blogspot.com/p/change-non-english-command-line.html

[ Releases ]

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

[ Suggestions ]

# Do you have one? Please drop me a line by email or the web site atop.

21 changes: 21 additions & 0 deletions Data/_elevate.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
' Subscript of Cmd Dict by wanderSick
' See main script -- fy.cmd -- for more details.

' Used to run desired programs as administrator (for Vista or later with UAC)
' Based on http://www.winhelponline.com/articles/185/1/VBScripts-and-UAC-elevation.html

Dim objShell, FSO
Dim strFolder, strFile
On Error Resume Next
Set objShell = CreateObject("Shell.Application")
Set FSO = CreateObject("Scripting.FileSystemObject")
strWorkDir = WScript.Arguments(0)
strFile = WScript.Arguments(1)
strArg = "/c start " & chr(34) & chr(34) & " /d " & chr(34) & strWorkDir & chr(34) & " " & chr(34) & strFile & chr(34)
'Debug line
'Msgbox strWorkDir & strFile & vbcrlf & strArg
If FSO.FileExists(strFolder & strFile) Then
objShell.ShellExecute "cmd.exe", strArg, "", "runas", 1
Else
MsgBox "File " & strFile & " not found."
End If
48 changes: 40 additions & 8 deletions englishize.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
@echo off

:: detech win ver
for /f "usebackq tokens=3 skip=2" %%i in (`reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion`) do (
@if %%i LSS 6.0 (
echo.
echo # ERROR: Englishize Cmd only supports Windows Vista or later.
echo.
pause
goto :EOF
)
)

:: 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.
for /f "usebackq tokens=3 skip=2" %%a in (`reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v UseWINSAFER 2^>nul`) do (
@if "%%a" EQU "0" (
@for /f "usebackq tokens=3 skip=2" %%i in (`reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v TrustPolicy 2^>nul`) do (
@if "%%i" GEQ "2" (
set noWSH=1
)
)
)
)

if defined noWSH (
echo.
echo # ERROR: Windows Scripting Host is disabled.
echo.
pause
goto :EOF
)

:: detect if system supports "attrib"
attrib >nul 2>&1
if "%errorlevel%"=="9009" set noAttrib=1
Expand All @@ -8,22 +40,22 @@ if "%errorlevel%"=="9009" set noAttrib=1
if defined noAttrib goto :skipAdminCheck
attrib -h "%windir%\system32" | find /i "system32" >nul 2>&1
if %errorlevel% EQU 0 (
echo.
echo :: ERROR: Admin rights required.
echo.
pause
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
)
:skipAdminCheck

cls



title Englishize Cmd v1.1 - by wanderSick.blogspot.com
title Englishize Cmd v1.3 - by wanderSick.blogspot.com
echo.
echo.
echo [ Englishize Cmd v1.1 ]
echo [ Englishize Cmd v1.3 ]
echo.
echo.
echo # This script changes command line interface to English.
Expand Down Expand Up @@ -58,4 +90,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.&pause"
48 changes: 40 additions & 8 deletions restore.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
@echo off

:: detech win ver
for /f "usebackq tokens=3 skip=2" %%i in (`reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion`) do (
@if %%i LSS 6.0 (
echo.
echo # ERROR: Englishize Cmd only supports Windows Vista or later.
echo.
pause
goto :EOF
)
)

:: 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.
for /f "usebackq tokens=3 skip=2" %%a in (`reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v UseWINSAFER 2^>nul`) do (
@if "%%a" EQU "0" (
@for /f "usebackq tokens=3 skip=2" %%i in (`reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v TrustPolicy 2^>nul`) do (
@if "%%i" GEQ "2" (
set noWSH=1
)
)
)
)

if defined noWSH (
echo.
echo # ERROR: Windows Scripting Host is disabled.
echo.
pause
goto :EOF
)

:: detect if system supports "attrib"
attrib >nul 2>&1
if "%errorlevel%"=="9009" set noAttrib=1
Expand All @@ -8,20 +40,20 @@ if "%errorlevel%"=="9009" set noAttrib=1
if defined noAttrib goto :skipAdminCheck
attrib -h "%windir%\system32" | find /i "system32" >nul 2>&1
if %errorlevel% EQU 0 (
echo.
echo :: ERROR: Admin rights required.
echo.
pause
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
)
:skipAdminCheck


cls
title Englishize Cmd v1.1 - by wanderSick.blogspot.com
title Englishize Cmd v1.3 - by wanderSick.blogspot.com
echo.
echo.
echo [ Englishize Cmd v1.1 ]
echo [ Englishize Cmd v1.3 ]
echo.
echo.
echo # This script restores the command line interface back to original
Expand All @@ -45,4 +77,4 @@ echo # Completed.
echo.
echo Press any key to run test . . .
pause >nul
start "" "%comspec%" /k "help&echo.&echo # Successful if the above is displayed in the original language&echo.&pause"
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"

0 comments on commit 9d6b837

Please sign in to comment.