Skip to content

Instantly share code, notes, and snippets.

@mejdi14
Last active January 27, 2021 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mejdi14/3fc2ba16a2718f4b4e161c0b87d845d0 to your computer and use it in GitHub Desktop.
Save mejdi14/3fc2ba16a2718f4b4e161c0b87d845d0 to your computer and use it in GitHub Desktop.
open a project directly from folder with Intellij on windows
1/ create a text file inside the Intellij product bin folder
exemple:
- C:\Program Files\Android\Android Studio\bin
- C:\Program Files\JetBrains\WebStorm 2020.2.1\bin
2/ copy the following code inside the file (open the file with notepadd++)
//////////////////// start of file
@echo off
set target=%1
if defined target (goto passedarg) else (goto noarg)
:passedarg
echo Starting AndroidStudio with '%target%'
"C:\Program Files\Android\Android Studio\bin\studio64.exe" %target%
goto:EOF
:noarg
echo Starting AndroidStudio with 'Current Dir'
"C:\Program Files\Android\Android Studio\bin\studio64.exe" .
//////////////////// end of file
the previous exemple is for android studio, just replace the distination with the product you wanna use
3/ save the file with '.bat' extenstion and name it whatever you want (in notepad++ chose bash 'unix type file' as the file type)
for example: studio.bat
so now we have this new file :
C:\Program Files\Android\Android Studio\bin\studio.bat
4/copy the bin folder distination
for our example it would be :
- C:\Program Files\Android\Android Studio\bin
5/ go to : Environment Variables -> path -> edit ==> and paste the bin distination then click ok
6/ open an android project folder, run terminal from that folder and just write 'studio' or in your case the name of the .bat file
and Voila the android studio will directly open the project without the need to open android studio and choosing the project from the open option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment