Last active
January 30, 2016 06:20
-
-
Save GGG-KILLER/2851d305302945f69530 to your computer and use it in GitHub Desktop.
Batch to make Atom portable
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 | |
:: Get current drive's letter. | |
set a=%~dp0 | |
echo Base path: %a% | |
:: Filesystem checking. | |
if not exist "%a%\Atom" ( | |
echo [ERROR]Atom folder not found. | |
goto error | |
) | |
if not exist "%a%\Atom\atom.exe" ( | |
echo [ERROR]Atom executable not found. | |
goto error | |
) | |
:: Environment vars setting | |
set ATOM_HOME=%a%\Atom\data | |
set USERPROFILE=%ATOM_HOME% | |
set APPDATA=%USERPROFILE%\AppData | |
echo ATOM_HOME: %ATOM_HOME% | |
echo USERPROFILE: %USERPROFILE% | |
echo APPDATA: %APPDATA% | |
if not exist "%ATOM_HOME%" mkdir "%ATOM_HOME%" | |
if not exist "%USERPROFILE%\AppData" mkdir "%USERPROFILE%\AppData" | |
if not exist "%USERPROFILE%\AppData\Roaming" mkdir "%USERPROFILE%\AppData\Roaming" | |
if not exist "%USERPROFILE%\Desktop" mkdir "%USERPROFILE%\Desktop" | |
:: Go to atom's folder and launch it. | |
:launch | |
cd Atom | |
start "" atom.exe | |
goto exit | |
:error | |
echo [ERROR]Atom folder MUST be in %a%, named Atom and atom's executable MUST be named atom.exe | |
set /p m=Press any key to leave... | |
goto exit | |
:exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment