Skip to content

Instantly share code, notes, and snippets.

@wvargas-ods
Last active June 18, 2021 14:04
Show Gist options
  • Save wvargas-ods/278e5dd724d7c01fc2801a1562dcb1a8 to your computer and use it in GitHub Desktop.
Save wvargas-ods/278e5dd724d7c01fc2801a1562dcb1a8 to your computer and use it in GitHub Desktop.
### Start apps on Windows
## Steps:
# 1. Open the Apps folder pressing <WIN> + <R> and type "shell:AppsFolder"
# 2. Create a shortcut for each app that you want to open using the script.
# * To create a shortcut, right-click on the app and click "Create shortcut".
# * I recommend creating a new folder to save all the shortcuts in one place.
# * It doesn't matter the names of the shortcuts, in my case, the shortcut of Visual Studio Code is "BestIDE".
# 3. Download/copy this script in your shortcuts folder.
# * It'll be easier to manage the paths if you have everything in one place.
# 4. Update the folder's path in the Set-Variable on line 18
# 5. Now, let's create a shortcut of the script so you can execute it as an app (with a double click).
# 6. On the script's shortcut, right-click and go to "properties" and update the Target with:
# powershell.exe -ExecutionPolicy Bypass -File "C:\Users\your_user_name\shortcuts\start_apps.ps1"
# 7. Click "OK" and move the script's shortcut to your desktop or any folder
# 8. Enjoy it!
Set-Variable C:\Users\your_user_name\shortcuts
# Examples:
Write-Output "Opening Slack" # Print message on terminal
Start-Process .\Slack.lnk # Start the shortcut
Start-Sleep -s 5 # Wait five seconds before start the next app
Write-Output "Opening Firefox"
Start-Process .\Firefox.lnk
Start-Sleep -s 5
Write-Output "Opening Visual Studio Code"
Start-Process .\BestIDE.lnk
Start-Sleep -s 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment