Add Open With Android Studio in Context Menu
Method 1 Edit Regedit Manually
In order to add Open with Android Studio in the context menu, we can follow the steps below:
- Open Run (Windows key + R)
- Type regedit, then Enter
- Go to HKEY_CLASSES_ROOT\Directory\shell
- Right click on the shell, then create a new key and name it as AndroidStudio
- On the right panel, add a new key Icon of type Expandable String Value
- Input Value data as Path_to_AndroidStudio,0 (D:\Program Files\Android\Android Studio\bin\studio64.exe,0)
- Right click on the AndroidStudio, then create a new key and name it as command
- On the right panel, editing (Default) key value as Path_to_AndroidStudio "%1" (D:\Program Files\Android\Android Studio\bin\studio64.exe "%1")
Method 2 Edit Regedit using script
@echo off:: change the path below to match your installed versionSET AndroidStudioPath=D:\Program Files\Android\Android Studio\bin\studio64.exeecho Adding file entries@reg add "HKEY_CLASSES_ROOT\*\shell\AndroidStudio" /t REG_SZ /v "" /d "Open with AndroidStudio" /f@reg add "HKEY_CLASSES_ROOT\*\shell\AndroidStudio" /t REG_EXPAND_SZ /v "Icon" /d "%AndroidStudioPath%,0" /f@reg add "HKEY_CLASSES_ROOT\*\shell\AndroidStudio\command" /t REG_SZ /v "" /d "%AndroidStudioPath% \"%%1\"" /fecho Adding within a folder entries@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\AndroidStudio" /t REG_SZ /v "" /d "Open with AndroidStudio" /f@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\AndroidStudio" /t REG_EXPAND_SZ /v "Icon" /d "%AndroidStudioPath%,0" /f@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\AndroidStudio\command" /t REG_SZ /v "" /d "%AndroidStudioPath% \"%%V\"" /fecho Adding folder entries@reg add "HKEY_CLASSES_ROOT\Directory\shell\AndroidStudio" /t REG_SZ /v "" /d "Open with AndroidStudio" /f@reg add "HKEY_CLASSES_ROOT\Directory\shell\AndroidStudio" /t REG_EXPAND_SZ /v "Icon" /d "%AndroidStudioPath%,0" /f@reg add "HKEY_CLASSES_ROOT\Directory\shell\AndroidStudio\command" /t REG_SZ /v "" /d "%AndroidStudioPath% \"%%1\"" /fpause{codeBox}
- Copy the context of this script to a file
- Edit AndroidStudioPath to android studio installation location
- and save it as open_with_androidstudio.cmd
- Run the script as Administrator
Reference:
- https://stackoverflow.com/questions/61036255/open-folder-as-android-studio-project