● [Video Tutorial] How to open multiple programs with ONE icon

Sat Dec 03, 2022 3:54 pm
Clan Leader
Top Dog
Nuke Dev / Coder
3056 Posts
coRpSE
Currently Offline
Offline

Most Played:
This week: 81.9hrs.
Total Played: 1,270hrs.


  
There is life outside of the game.
Reputation: 7420
votes: 7
Have you ever gotten tired of having a bunch of shortcuts all over your desktop slowing down your computer, and making a mess of it, but like the ability to open up programs quickly and easily? If you're like me, and use icons in your start menu, do you hate clicking start, then finding your app, clicking it to start it, and repeat for your other apps?

Well, for some of you, you know me enough to know that I am lazy, and if I could automate something, I will. This video tutorial, I go over how to code a single batch file to open up multiple programs like, TeamSpeak 3, Discord, and Steam with one click.

I know I say this in the video, but I will put it here. I know you can have it start up when I start my PC, but I don't always want that, so I DON'T DO THAT.




Here is the code:
** USE THIS ONLY FOR AN EXAMPLE, YOUR FILE PATHS MORE & LIKELY DIFFER **

Code: [ Select all ]

@echo off

:: Launch Discord
start "" /D "C:\Users\YOURNAME\AppData\Local\Discord" "Update.exe" --processStart Discord.exe

:: Launch Steam
start "" /D "D:\Program Files (x86)\Steam" "steam.exe"

:: Launch TeamSpeak 3
start "" /D "D:\Program Files\TeamSpeak 3 Client" "ts3client_win64.exe"

exit




Update 2/19/2025

Okay, it's a new year and time for some new coding. I have been making small tweaks here and there to my script every time I need to do a change my self. A few months ago when I started to play Once Human, I noticed I was unable to mute Discord using my hotkey that I had set up within Discord if I was in game. Come find out, Discord, if it isn't in focus, will not ignore your binds/hotkeys that you set up within it. The only way that they were saying was a workaround, was to enable their overlay. Me, i HATE unnecessary overlays and never want them on my screen or taking up unnecessary resources. I can see it helpful if you have a single monitor, but with me have 3, it's unnecessary.

After researching the problem, I found a post by one person that said that running it in administrator fixed that issue for them, and they didn't need to use the overlay like Discord was saying for everyone to use. Well, finding this to be the case and since I use this launcher every day, I needed to make it so I could elevate the permissions of Discord. To do that, I used the same technique that I used in my Windows 10 batch utility I wrote a few years back. Here is my updated code and what I did differently with this one:

Code: [ Select all ]

@echo off
:: Check for administrative privileges
net session >nul 2>&1
if %errorlevel% NEQ 0 goto UACPrompt

:gotAdmin
pushd "%~dp0"

:: Launch Discord as Admin
start "" /D "C:\Users\YOURNAME\AppData\Local\Discord" "Update.exe" --processStart Discord.exe

:: Launch Steam
start "" /D "D:\Program Files (x86)\Steam" "steam.exe"

:: Launch TeamSpeak 3
start "" /D "D:\Program Files\TeamSpeak 3 Client" "ts3client_win64.exe"

exit

:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
cscript "%temp%\getadmin.vbs" //NoLogo
del "%temp%\getadmin.vbs"
exit



Of course, like the original script above, you will need to edit your file paths to match what you have on your computer. I posted using my paths since I don't install everything on my C drive. And of course, you can launch more programs then the ones that I posted. Those are just the ones I use for gaming.




Batch Script Breakdown - (Explanation)
I am doing this because I was asked to in the past.
(I remember you asking, you know who you are.)

1. Ensure the Script Runs as Administrator

Code: [ Select all ]


@echo off
:: Check for administrative privileges
net session >nul 2>&1
if %errorlevel% NEQ 0 goto UACPrompt

Explanation:  
  • @echo off - hides unnecessary command output.  
  • net session >nul 2>&1 - checks if the script has admin rights.  
  • if %errorlevel% NEQ 0 goto UACPrompt - runs the UAC prompt if admin rights are missing.



2. Set the Script’s Working Directory

Code: [ Select all ]


:gotAdmin
pushd "%~dp0"

Explanation:  
  • pushd "%~dp0" - makes sure the script runs from its current directory.



3. Launch services as Administrator

Code: [ Select all ]


:: Launch Discord as Admin
start "" /D "C:\Users\dread\AppData\Local\Discord" "Update.exe" --processStart Discord.exe

:: Launch Steam
start "" /D "D:\Program Files (x86)\Steam" "steam.exe"

:: Launch TeamSpeak 3
start "" /D "D:\Program Files\TeamSpeak 3 Client" "ts3client_win64.exe"

Explanation:  
  • start "" - opens a new process (empty quotes prevent issues).  
  • /D "C:\Users\YOURNAME\AppData\Local\Discord" - sets the working directory.  
  • "Update.exe" --processStart Discord.exe - starts Discord properly.
  • Steam and TS3 start the same as Discord, pretty much.



4. Exit the Script

Code: [ Select all ]


exit

Explanation:  
  • exit - closes the batch script once everything is launched.



5. Request Admin Privileges if Needed

Code: [ Select all ]


:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
cscript "%temp%\getadmin.vbs" //NoLogo
del "%temp%\getadmin.vbs"
exit

Explanation:  
  • Creates a temporary VBScript (`getadmin.vbs`) to request admin rights.  
  • Runs the script to restart the batch file with admin privileges.  
  • Deletes the temporary script after execution.


Expand
Sat Dec 03, 2022 5:38 pm
Spammer
132 Posts
Zardos
Currently Offline
Offline
  
Doesn't like playing games!
Reputation: 917.8
Nice one coRpSE.  daumen rauf


Please login to see this link
Get registered or Log in
Sat Dec 03, 2022 7:39 pm
Original Poster
Clan Leader
Top Dog
Nuke Dev / Coder
3056 Posts
coRpSE
Currently Offline
Offline

Most Played:
This week: 81.9hrs.
Total Played: 1,270hrs.


  
There is life outside of the game.
Reputation: 7420
votes: 7
Thanks. I know many people will not use this, but, I do know besides me, there was one other that felt the same, so I put this together for anyone else that felt the same.


 
Wed Feb 19, 2025 8:06 am
Original Poster
Clan Leader
Top Dog
Nuke Dev / Coder
3056 Posts
coRpSE
Currently Offline
Offline

Most Played:
This week: 81.9hrs.
Total Played: 1,270hrs.


  
There is life outside of the game.
Reputation: 7420
votes: 7
Okay, I updated my original script and added a new version as well, as well as an explanation breakdown since I have been asked to do that more because people don't understand what everything does. If I need to go into more details, let me know, or fewer details, either way.

I also updated the original script, removing the unnecessary cd /d since each program is launched without changing directories. Also, by using start, this will ensure that the programs launch simultaneously rather than sequentially., layman: loads faster.

I hope this helps some people, I know since I first started using it, it's a time saver for me.


 
Forums ©