Skip to content

Instantly share code, notes, and snippets.

@ar-to
Last active January 1, 2025 13:59
Show Gist options
  • Save ar-to/31f4fa6142c31eb299fba738316c9a4c to your computer and use it in GitHub Desktop.
Save ar-to/31f4fa6142c31eb299fba738316c9a4c to your computer and use it in GitHub Desktop.
Batch script to automate opening urls, apps, and folders in Windows 10
@echo off
REM delete this line before using. The script below prints information, asks the user for confirmation before running the commands. Review commands and change to fit your needs and also your local username.
REM delete this line before using. This script require Git Bash for windows; see https://gist.github.com/ar-to/82fcaac189fff0cfb836a6922e542e9e
ECHO This is my auto OpenDevs batch script!
ECHO This batch script will open the following urls:Trello, Timelyapp, GitHub/ar-to, Slack, Wunderlist, Gitter, DevSource
ECHO This batch script will open the following apps:File Explorer(repos), Visual Studio Code, Git Bash(~),
ECHO system files (.bash_profile, .bashrc) are located in C:\Users\Ari\
REM commands below will open new window for firefox browser; an alternative way to above
SET BROWSER=firefox.exe
SET WAIT_TIME=2
START %BROWSER% -new-window https://asana.com/, https://github.com/ar-to
setlocal
:PROMPT
SET /P AREYOUSURE=Are you sure (Y/[N])?
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END
REM This will execute programs
start /d "C:\Program Files (x86)\Microsoft VS Code" Code.exe
start /d "C:\Program Files\Git" git-bash.exe
REM the following command "C:\Program Files (x86)\Microsoft VS Code/Code.exe" below runs the app on the cmd.exe but stops the next command when used in batch; so the above syntax is prefered to avoid this in batch
REM This will open folders
%SystemRoot%\explorer.exe "D:\repos"
REM This will open URLs
start /d "C:\Program Files (x86)\Google\Chrome\Application" chrome.exe http://philosophyanddesign.com https://ehspook.com
start microsoft-edge:https://github.com/ar-to
start microsoft-edge:https://slack.com/
start microsoft-edge:https://gitter.im/
start microsoft-edge:https://devsource.herokuapp.com/
REM optional
REM start microsoft-edge:https://www.dropbox.com/
:END
endlocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment