@echo off
CLS
color 1f

TITLE Checking for Admin...
echo.
cd %systemroot%\system32
call :IsAdmin

TITLE PowerShell Prompt Context Menus
cls
color 1f
echo.
REM Enable Unicode
chcp 65001 >nul

echo.
echo Press enter without anything written to set auto translated.
echo.
SET /p "P1=Enter in your native language for: Windows Powershell "
IF /I "%P1%"=="" SET "P1=@%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe,-109"
echo.
SET /p "E1=Enter in your native language for: Administrator "
IF /I "%E1%"=="" SET "E1=@%SystemRoot%\system32\shell32.dll,-21763"
echo.

SET "Below8="
for /f "tokens=4-5 delims=. " %%i in ('ver') do set "TestWinVer=%%i.%%j"
IF "%TestWinVer%"=="6.1" SET "Below8=1"
IF "%TestWinVer%"=="6.0" SET "Below8=1"

REM Powershell Prompt
 reg add "HKCR\Directory\shell\MenuPowerShell" /v "MUIVerb" /t REG_SZ /d "%P1%" /f >nul 2>&1
 reg add "HKCR\Directory\shell\MenuPowerShell" /v "Icon" /t REG_SZ /d "powershell.exe" /f >nul 2>&1
 reg add "HKCR\Directory\shell\MenuPowerShell" /v "ExtendedSubCommandsKey" /t REG_SZ /d "Directory\ContextMenus\MenuPowerShell" /f >nul 2>&1
 reg add "HKCR\Directory\shell\MenuPowerShell" /v "Position" /t REG_SZ /d "Top" /f >nul 2>&1

 reg add "HKCR\Directory\background\shell\MenuPowerShell" /v "MUIVerb" /t REG_SZ /d "%P1%" /f >nul 2>&1
 reg add "HKCR\Directory\background\shell\MenuPowerShell" /v "Icon" /t REG_SZ /d "powershell.exe" /f >nul 2>&1
 reg add "HKCR\Directory\background\shell\MenuPowerShell" /v "ExtendedSubCommandsKey" /t REG_SZ /d "Directory\ContextMenus\MenuPowerShell" /f >nul 2>&1
 reg add "HKCR\Directory\background\shell\MenuPowerShell" /v "Position" /t REG_SZ /d "Top" /f >nul 2>&1

 reg add "HKCR\LibraryFolder\background\shell\MenuPowerShell" /v "MUIVerb" /t REG_SZ /d "%P1%" /f >nul 2>&1
 reg add "HKCR\LibraryFolder\background\shell\MenuPowerShell" /v "Icon" /t REG_SZ /d "powershell.exe" /f >nul 2>&1
 reg add "HKCR\LibraryFolder\background\shell\MenuPowerShell" /v "ExtendedSubCommandsKey" /t REG_SZ /d "Directory\ContextMenus\MenuPowerShell" /f >nul 2>&1
 reg add "HKCR\LibraryFolder\background\shell\MenuPowerShell" /v "Position" /t REG_SZ /d "Top" /f >nul 2>&1

 reg add "HKCR\Drive\shell\MenuPowerShell" /v "MUIVerb" /t REG_SZ /d "%P1%" /f >nul 2>&1
 reg add "HKCR\Drive\shell\MenuPowerShell" /v "Icon" /t REG_SZ /d "powershell.exe" /f >nul 2>&1
 reg add "HKCR\Drive\shell\MenuPowerShell" /v "ExtendedSubCommandsKey" /t REG_SZ /d "Directory\ContextMenus\MenuPowerShell" /f >nul 2>&1
 reg add "HKCR\Drive\shell\MenuPowerShell" /v "Position" /t REG_SZ /d "Top" /f >nul 2>&1

 reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\open" /v "MUIVerb" /t REG_SZ /d "%P1%" /f >nul 2>&1
 reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\open" /v "Icon" /t REG_SZ /d "powershell.exe" /f >nul 2>&1
 reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\open\command" /ve /t REG_SZ /d "powershell.exe -noexit -command Set-Location '%%V'" /f >nul 2>&1
 
 REM If Windows 7 or below adjust command line.
 IF DEFINED Below8 reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\open\command" /ve /t REG_SZ /d "%WinDir%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit -command Set-Location '%%V'" /f >nul 2>&1

 reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\runas" /v "MUIVerb" /t REG_SZ /d "%E1%" /f >nul 2>&1
 reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\runas" /v "Icon" /t REG_SZ /d "powershell.exe" /f >nul 2>&1
 reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\runas" /v "HasLUAShield" /t REG_SZ /d "" /f >nul 2>&1
 reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\runas\command" /ve /t REG_SZ /d "powershell.exe -noexit -command Set-Location '%%V'" /f >nul 2>&1

 REM If Windows 7 or below adjust command line.
 IF DEFINED Below8 reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\runas\command" /ve /t REG_SZ /d "%WinDir%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit -command Set-Location '%%V'" /f >nul 2>&1

SET "Below8="
set "TestWinVer="
echo.
echo Done.

echo.
Pause
exit
=====================================================================================
:IsAdmin
Reg.exe query "HKU\S-1-5-19\Environment"
If Not %ERRORLEVEL% EQU 0 (
 Cls & echo. & Echo You must have administrator rights to continue ... & echo.
 Pause & Exit
)
Cls

exit /b