1

First of all, I am not a coder or developer and I apologize for any ignorance from this moment forward.

I am trying to make a simple batch file that will open multiple programs and uwp apps. For example, at the start of my work day I need several programs and apps to get up and running such as edge, skype, outlook16, onenote (uwp app not program), etc.

I can get normal windows programs that use .exe to do this but I am having difficulty finding out how to do the same with windows UWP.

Any help would be appreciated.

  • Possible duplicate of [UWP app start automatically at startup](https://stackoverflow.com/questions/35940683/uwp-app-start-automatically-at-startup) – cptwonton Feb 05 '18 at 18:07
  • I think it is not a duplicate, the OP wants to startup apps he didn't build himself after launch. – Martin Zikmund Feb 05 '18 at 18:09

2 Answers2

1

It is a bit tricky with UWP apps, but you can definitely make it.

Put the live tiles of the UWP apps you want a shortcut to in the start menu. And then drag and drop the tile itself on the Desktop. This will create a shortcut to that app. Now you can manually launch the shortcut via the batch file, or even more easily - copy the created shortcuts into the Startup folder:

C:\Users\{username}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

You can open this folder even faster by hitting Windows + R and typing shell:startup.

Other option for launching the apps would be to use their associated URI protocol. OneNote has onenote-cmd: or onenote:, Edge has microsoft-edge: (or you can use any website URL if it is your default browser). There are more URI schemes, a short list is available here for example.

Martin Zikmund
  • 38,440
  • 7
  • 70
  • 91
  • Martin Zikmund is right,as a simple example,you can try this in your batch file: start onenote-cmd: this will open onenote uwp app – Charlie Mar 21 '20 at 02:53
1

I do not know about UWP, but these may be. I wrote this answer because it was high on my search and most answer I found had little examples. And this provides a few more ideas for programs that run in the taskbar(in the background).

Here is my "Work Start.bat" batch file sitting on my desktop:

rem   Work Start Batch Job from Desktop
rem   Launchs All Work Apps
@echo off
rem start "Start VS Code" "C:\Users\yourname\AppData\Local\Programs\Microsoft VS Code\code.exe"
start "Start OneDrive" "C:\Users\yourname\AppData\Local\Microsoft\OneDrive\OneDrive.exe"
start  "Start Google Sync" "C:\Program Files\Google\Drive\GoogleDriveSync.exe"
start "Start Clipboard" "C:\Program Files\Beyond Compare 4\BCClipboard.exe"
start "Start Cisco AnyConnect" "C:\Program Files (x86)\Cisco\Cisco AnyConnect Secure Mobility Client\vpnui.exe"
start outlook
start chrome
start firefox
start skype
start "Start Teams" "C:\Users\yourname\AppData\Local\Microsoft\Teams\current\Teams.exe" /MIN
start Slack
start Zoom
sleep 10
taskkill /IM "explorer.exe"
taskkill /IM "teams.exe"
taskkill /IM "skype.exe"
taskkill /IM "slack.exe"
taskkill /IM "zoom.exe"
taskkill /IM "cmd.exe"
@echo on

Some Apps would not start with a simple "start app" command, so I used the full path. For some reason some were found in my user appdata folder and not in program files, I do not understand this behaviour of program storage, it makes no sense.

I used a time delay so that the apps could fully start before I sent them to the background using taskkill command I killed explorer.exe because OneDrive opens explorer I killed cmd.exe because it opened and stayed opened due to badly behaving apps. The rest I killed so that they would just move to the background.

Here is my "Work End.bat" batch file to forceably close everything:

rem   Work End Batch Job from Desktop
rem   Forcibly Closes All Work Apps
@echo off
taskkill /f /IM outlook.exe
taskkill /f /IM OneDrive.exe
taskkill /f /IM GoogleDriveSync.exe
taskkill /f /IM BCClipboard.exe
taskkill /f /IM "vpnui.exe"
taskkill /f /IM "chrome.exe"
taskkill /f /IM "firefox.exe"
taskkill /IM "explorer.exe"
taskkill /f /IM "teams.exe"
taskkill /f /IM "skype.exe"
taskkill /f /IM "slack.exe"
taskkill /f /IM "zoom.exe"
@echo on

I do have to ensure I have saved all my work, and that files are no longer syncing. Possibly I will need a batch file that kills everything except file sync. The good thing about forceably killing Chrome and firefox is they ask to be restored on next start, so I can continue where I left off, assuming I saved everything. If I don't forceably kill these they stay in the background, if I close using the Cross they do not offer me to start from where I left off.

I could then start my gaming files, in another batch file but this would be similar to the first file.

Now I can turn off the default "Start Up" Apps and use this "Work Start.bat" , because the Start Up Apps annoy me when I start my pc for gaming.

TheArchitecta
  • 273
  • 2
  • 17