Skip to content

Instantly share code, notes, and snippets.

@ebicoglu
Last active April 22, 2024 02:45
Show Gist options
  • Save ebicoglu/5a8a2921ba6ed62eef88eec7943c0440 to your computer and use it in GitHub Desktop.
Save ebicoglu/5a8a2921ba6ed62eef88eec7943c0440 to your computer and use it in GitHub Desktop.
Useful developer Windows right click items (context menu)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Command Prompt *]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Command Prompt *\command]
@="cmd.exe /s /k pushd \"%V\""
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; Created on: December 30th 2016
; Tutorial: https://www.tenforums.com/tutorials/73649-copy-path-add-context-menu-windows-10-a.html
[HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\windows.copyaspath]
"CanonicalName"="{707C7BC6-685A-4A4D-A275-3966A5A3EFAA}"
"CommandStateHandler"="{3B1599F9-E00A-4BBF-AD3E-B3F99FA87779}"
"CommandStateSync"=""
"Description"="@shell32.dll,-30336"
"Icon"="imageres.dll,-5302"
"InvokeCommandOnSelection"=dword:00000001
"MUIVerb"="@shell32.dll,-30329"
"VerbHandler"="{f3d06e7c-1e45-4a26-847e-f9fcdee59be0}"
"VerbName"="copyaspath"
[HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\CopyAsPathMenu]
@="{f3d06e7c-1e45-4a26-847e-f9fcdee59be0}"

HOW TO INSTALL


1- install rimraf with the following command

npm install rimraf -g

2- create a file named as delete.bat and copy the below contents. Then move it to c:\windows\system32\

3- run fast-delete.reg file to import to your registry.


delete.bat

@ECHO OFF
ECHO.
ECHO %CD% 
ECHO.
ECHO Are you sure to delete the folder with RimRaf?
PAUSE
SET FOLDER=%CD%
CD /

rimraf "%FOLDER%"

rem DEL /F/Q/S "%FOLDER%" > NUL
rem RMDIR /Q/S "%FOLDER%"

EXIT

fast-delete.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\Delete with Rimraf\command]
@="cmd /c \"cd %1 && delete.bat\""
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Dotnet Run *\command]
@="cmd /s /k dotnet build \"%V\""
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Dotnet Restore *]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Dotnet Restore *\command]
@="cmd /s /k dotnet restore \"%V\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\SystemFileAssociations\.csproj\shell\Run Csproj\command]
@="cmd /s /k dotnet run --project \"%1\""
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Dotnet Run *\command]
@="cmd /s /k dotnet run \"%V\""
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Run Angular *]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Run Angular *\command]
@="cmd /s /k npm start -prefix \"%V\""
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Users\\alper\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Users\\alper\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Users\\alper\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
@="\"C:\\Users\\alper\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Users\\alper\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
@="\"C:\\Users\\alper\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%V\""
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\* Powershell\command]
@="PowerShell Start-Process PowerShell '-noexit -command Set-Location -literalpath ''%V''' -Verb RunAs"
[HKEY_CLASSES_ROOT\Directory\shell\* Powershell\command]
@="PowerShell Start-Process PowerShell '-noexit -command Set-Location -literalpath ''%V''' -Verb RunAs"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Pull From GitHub *\command]
@="cmd /s /k git pull origin"
@ebicoglu
Copy link
Author

ebicoglu commented Dec 14, 2020

right-click-dev-tools
copy-file-path

@vivekwebm2020
Copy link

vivekwebm2020 commented Feb 4, 2022

Hi @ebicoglu, I have similar quoting issue in multiple commands being run at Registry with CMD, can you help fix it ?

I am trying to create a .reg file which can be imported in any Windows 7-10 system which after imported, provides a context-menu option to confirm with User whether to delete logs in a specific directory and then open that same directory in Explorer.

Now the .reg file I have created apparently looks correct syntax wise and it also opens the CMD prompt, but it doesn't execute the commands due to error.

Here's that .reg file:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\FolderName_Logs]
@="Open folder-name's Logs"

[HKEY_CLASSES_ROOT\Directory\Background\shell\FolderName_Logs\command]
@="cmd /s /k \"set \"\"LogsDir=C:\\projects\\folder-name\\storage\\logs\"\" && if exist \"\"!LogsDir!\"\" (set /p ch=\"\"Delete Logs? \"\" && if /i !ch! equ 'y' del /f /s /q \"\"!LogsDir!\\*.log\"\") && start \"\"\"\" \"\"!LogsDir!\"\"\""

@ebicoglu
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment