Setting up a new Windows PC can be a tedious process. Aside from the fact that installing Windows 11 itself can take some time — especially with all the prompts and "promotional offers" that are forced upon you — you then have to install all of your apps, which can be numerous and take a while to set up. What's worse, you normally can't just leave the computer to do its thing because you need to individually download and run all of these installers.
But what if you didn't have to? Well, that's exactly where the Windows Package Manager, or Winget, comes in with a party trick you may not know about. Winget is already one of the best ways to install all your apps with one centralized source, but it can also make it easy to install all your apps in one fell swoop. Here's how.
Installing and exporting your apps
Getting started
In order to install your apps in one go on a new PC, you first have to export the list of apps you want to roam. For this to work more seamlessly, your apps should have been installed using Winget from the get-go, so they're properly registered with the package manager, making them possible to export. Apps installed from the Microsoft Store should also automatically register and become exportable.
If you have everything ready, exporting your app list is easy. All you need to do is open Windows Terminal with administrator permissions and run the following command:
winget export -o C:\MyApps.json --accept-source-agreements
You can replace the path at the end with whatever path you want the exported file to be saved to, and also change its name, as long as it has the .json extension. If you want, you can also add the --include-versions argument at the end of the command, which will not only save the information about the packages, but the specific versions you have installed, so you can restore those versions instead of installing the latest ones for each app.
This will begin a check to make sure your installed apps are available from the sources you have available (typically, that will be the Winget repository and the Microsoft Store). For every app that has a match, an entry will be added to the JSON file.
Review the exported file
Make sure it's all right
Before you start using the exported file, it's a good idea to open it using Notepad to see if all the packages you need are there, or if there are any apps you don't want to restore on other PCs. This may seem redundant, but it's not guaranteed that you need every app from one computer on your other machine, so cleaning up the list is a good idea.
The list has a clearly structured format, so you can easily remove entries that you consider unnecessary. Simply select the content that refers to each specific package you want to remove, including the brackets and the empty space on those lines, so that the final document looks the same without those entries.
Additionally, you might be able to add packages to the list by following the provided format. You can simply copy and paste an existing entry to duplicate it, then change the package identifier to match the package you want to include. You can use Winget to search for packages and find their package identifiers. For example, for Steam, the package identifier is Valve.Steam, so the content you need to add would look like this:
Of course, it's generally easier to have these apps installed beforehand so they get exported in one go.
Importing the file
Set up your new Windows PC
Once the MyApps.json file (or whatever you named it) is created and looks how you want it to, you'll want to move it to an external source, such as a USB drive or maybe OneDrive, which is integrated with Windows out of the box. This will make it possible to access your exported app list on other devices. You can choose whatever you prefer, but keep in mind you'll need to use the right path to the file when importing your apps.
On your new Windows PC, you'll need to run this command to import your apps (with the changes to select the appropriate path):
winget import -i D:\MyApps.json --accept-source-agreements --accept-package-agreements --disable-interactivity
The command above assumes you stored the exported file in the root of a USB drive, but the drive letter may be different. If you used OneDrive, the path may also be something like C:\Users\joaoc\OneDrive\MyApps.json, where joaoc would be replaced with your user folder's name.
The arguments used at the end are important, so you can run this command and leave the PC alone for a while. The --accept-source-agreements and --accept-package-agreements commands will automatically accept the prompts from winget itself to install the apps, and --disable-interactivity will disable the app installers themselves from asking for user input, so all the apps can be installed in one go without needing any intervention from you.
Making life easier
If you're someone who often sets up new PCs, whether they're physical hardware or virtual machines, and you need access to a specific set of apps, the ability to export and import all your apps in one go can save you a ton of time. All your apps start installing consecutively, and you don't even need to be in front of the computer while it happens. If you're setting up multiple PCs in a classroom, for example, this can be especially useful for setting them all up much more quickly.
Other package managers outside of Winget also offer similar functionality, including UniGetUI, which actually includes all the apps from Winget, but also other package managers like Chocolatey and Scoop. Still, Winget is built right into Windows and works very well already, so there's no need to go looking for other solutions.
