Skip to content

Commit

Permalink
Add old context menu option for Windows 11
Browse files Browse the repository at this point in the history
  • Loading branch information
GChuf committed Nov 26, 2021
1 parent e2594be commit 673a1a3
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 26 deletions.
42 changes: 21 additions & 21 deletions RCWM/files/RCopy.reg
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Windows Registry Editor Version 5.00

;robocopy

[HKEY_CLASSES_ROOT\Directory\shell\rcopy]
@="RoboCopy Directory"
"NoWorkingDirectory"=""
"Icon"="rcwmimg.dll,-5"

[HKEY_CLASSES_ROOT\Directory\shell\rcopy\command]
@="cmd.exe /c echo \"%1\">C:\\Windows\\System32\\RCWM\\rc.log"
"IsolatedCommand"="cmd.exe /c echo \"%1\">C:\\Windows\\System32\\RCWM\\rc.log"

[HKEY_CLASSES_ROOT\Directory\Background\shell\rpaste]
@="RoboPaste Directory"
"Icon"="rcwmimg.dll,-6"
[HKEY_CLASSES_ROOT\Directory\Background\shell\rpaste\command]
@="cmd.exe /c C:\\Windows\\System32\\RCWM\\Rcopy.bat"


; end
Windows Registry Editor Version 5.00

;robocopy

[HKEY_CLASSES_ROOT\Directory\shell\rcopy]
@="RoboCopy Directory"
"NoWorkingDirectory"=""
"Icon"="rcwmimg.dll,-5"

[HKEY_CLASSES_ROOT\Directory\shell\rcopy\command]
@="cmd.exe /c echo \"%1\">C:\\Windows\\System32\\RCWM\\rc.log"
"IsolatedCommand"="cmd.exe /c echo \"%1\">C:\\Windows\\System32\\RCWM\\rc.log"

[HKEY_CLASSES_ROOT\Directory\Background\shell\rpaste]
@="RoboPaste Directory"
"Icon"="rcwmimg.dll,-6"
[HKEY_CLASSES_ROOT\Directory\Background\shell\rpaste\command]
@="cmd.exe /c C:\\Windows\\System32\\RCWM\\Rcopy.bat"


; end
11 changes: 11 additions & 0 deletions RCWM/files/Win11AddOldContextMenu.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Windows Registry Editor Version 5.00

;Add old context manu

[HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}]
@=""

[HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32]
@=""

;done
25 changes: 20 additions & 5 deletions RCWM/install.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title RCWM Install Script
color 3

rem https://stackoverflow.com/questions/8610597/batch-file-choice-commands-errorlevel-returns-0
SETLOCAL EnableDelayedExpansion


REM Get Admin Privileges
REM Taken from: https://stackoverflow.com/questions/11525056/how-to-create-a-batch-file-to-run-cmd-as-administrator
Expand All @@ -25,7 +28,7 @@ echo(
echo *********************************
echo ****** RCWM Install Script ******
echo *********************************
echo ************************v1.3*****
echo ************************v1.4*****
echo * https://github.com/GChuf/RCWM *
echo *********************************
echo(
Expand All @@ -35,9 +38,7 @@ echo(
cd files

rem powershell version check
FOR /F "tokens=* USEBACKQ" %%F IN (`powershell $psversiontable.psversion.major`) DO (
SET pwsh=%%F
)
FOR /F "tokens=* USEBACKQ" %%F IN (`powershell $psversiontable.psversion.major`) DO ( SET pwsh=%%F )

IF %pwsh% LSS 5 (
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" ( echo Using powershell version older than 5 on 32bit CPU. ) else ( echo Using powershell version older than 5 on 64bit CPU. )
Expand All @@ -49,7 +50,7 @@ IF %pwsh% LSS 5 (
powershell "echo '$n = -join ((0,1,2,3,4,5,6,7,8,9,\"a\",\"b\",\"c\",\"d\",\"e\",\"f\")|get-random -count 6)' | Out-File mvdir.ps1"
powershell "echo '(get-location).path|out-file C:\windows\system32\rcwm\mv\$n -encoding UTF8'|Out-File mvdir.ps1 -Append"

) ELSE (
) ELSE (
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" ( echo Using powershell version 5 or newer on 32bit CPU. ) else ( echo Using powershell version 5 or newer on 64bit CPU. )
)

Expand All @@ -73,6 +74,20 @@ echo Choose the options that you want to apply to your right-click menu.
echo You will be asked separately for each option (divided into Add and Remove sections).
echo(


FOR /F "tokens=*" %%g IN ('powershell "([Environment]::OSVersion).Version.Major"') do (SET WinVer=%%g)
echo(

IF %WinVer% == 11 (
choice /C yn /M "Do you want to enable old context menu in Windows 11 "
if !errorlevel! == 1 (
start /w regedit /s Win11AddOldContextMenu.reg
)
)

echo(
color c

choice /C yn /M "Do you want to Add right-click menu options "
if %errorlevel% == 1 ( goto Add ) else ( goto RemoveOptions )

Expand Down
7 changes: 7 additions & 0 deletions RCWM/uninstall/Win11RevertToDefaultContextMenu.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Windows Registry Editor Version 5.00

;revert back to Win11 default context menu

[-HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}]

;done

0 comments on commit 673a1a3

Please sign in to comment.