Last active
May 3, 2023 12:00
-
-
Save Amm1rr/c20812789aedc47d3a147f182a921172 to your computer and use it in GitHub Desktop.
Add a "Open with JetBrains" to windows click right menu that can open Folders and Files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
COLOR b | |
rem First change IDEPath to correct path to your JetBrains IDEs | |
rem Then change IDEName to anything you want. | |
rem Done! | |
SET PhpStormPath=C:\Program Files\JetBrains\PhpStorm 2016.2.1\bin\PhpStorm64.exe | |
SET PyCharmPath=C:\Program Files\JetBrains\PyCharm 2020.3.3\bin\pycharm64.exe | |
SET IDEPath=%PyCharmPath% | |
SET IDEName=PyCharm | |
SET STATUS=%IDEName% ~ %IDEPath% | |
GOTO START | |
:AddRegistery | |
ECHO. Adding file entries | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in %IDEName%" /t REG_SZ /v "" /d "Open in %IDEName%" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in %IDEName%" /t REG_EXPAND_SZ /v "Icon" /d "%IDEPath%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in %IDEName%\command" /t REG_SZ /v "" /d "%IDEPath% \"%%1\"" /f | |
ECHO. Adding folder entries | |
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open directory in %IDEName%" /t REG_SZ /v "" /d "Open directory in %IDEName%" /f | |
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open directory in %IDEName%" /t REG_EXPAND_SZ /v "Icon" /d "%IDEPath%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open directory in %IDEName%\command" /t REG_SZ /v "" /d "%IDEPath% \"%%1\"" /f | |
Set STATUS=Successfully Added to Registry ! | |
GOTO EXIT | |
:RemoveRegistry | |
ECHO. Removing from Registry | |
@reg delete "HKEY_CLASSES_ROOT\*\shell\Open in %IDEName%" /va /f | |
@reg delete "HKEY_CLASSES_ROOT\Directory\shell\Open directory in %IDEName%" /va /f | |
Set STATUS=Successfully Removed from Registry ! | |
GOTO EXIT | |
:INPUT | |
set /P INPUT=Choose an option: %=% | |
IF "%INPUT%"=="exit" ( | |
Exit | |
) | |
IF "%INPUT%"=="Exit" ( | |
Exit | |
) | |
IF "%INPUT%"=="EXIT" ( | |
Exit | |
) | |
IF "%INPUT%"=="0" ( | |
Exit | |
) | |
IF "%INPUT%"=="9" ( | |
CLS | |
ECHO. | |
ECHO. Created by Soheyl [Mohammad Khani] | |
ECHO. _________________ | |
ECHO. | |
ECHO. JetBrains IDE Path | |
ECHO. --- --- | |
ECHO. %IDEName% ~ %IDEPath% | |
ECHO. | |
ECHO. _________________ | |
ECHO. | |
ECHO. IF IDE path is not correct, Fix It. | |
ECHO. | |
ECHO. _________________ | |
ECHO. | |
ECHO. | |
PAUSE | |
GOTO Start | |
) | |
IF "%INPUT%"=="1" ( | |
CLS | |
Set STATUS=Status: Added To Right Click Seccuced ! | |
GOTO AddRegistery | |
) | |
IF "%INPUT%"=="2" ( | |
CLS | |
Set STATUS=Status: Removed From Right Click Seccuced ! | |
GOTO RemoveRegistry | |
) | |
Set STATUS=Status: Choose a valid option! (beetween 1 and 2) | |
GOTO Start | |
:START | |
CLS | |
ECHO. | |
ECHO. | |
ECHO. Created by Amir (MKH) | |
ECHO. | |
ECHO. - First fix paths in this bat file | |
ECHO. | |
ECHO. - Run as Admin (*) | |
ECHO. | |
ECHO._____________________________________ | |
ECHO. | |
ECHO. 1.) Add to Registry | |
ECHO. 2.) Remove from Registry | |
ECHO. | |
ECHO. 9- About | |
ECHO. 0- Exit | |
ECHO. | |
ECHO.----------------- | |
ECHO. | |
ECHO. %STATUS% | |
ECHO. | |
ECHO. | |
GOTO INPUT | |
:EXIT | |
SET /A count=0 | |
:WAIT | |
IF NOT %count% == 2000 ( | |
Set /A count += 1 | |
rem ECHO %count% | |
GOTO WAIT | |
) | |
EXIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment