Technical Anshu
Tutorials Blog
💾 PC Setup Script

One Command New PC Setup With Winget Export and Import

A new PC should not mean an evening of download pages. Export your app list once, and every future PC rebuild becomes a single command.

✍️ Technical Anshu🪟 Windows⏱️ 7 minute read
🎥 Watch all three methods side by side in the full video

Winget can write your installed apps to a JSON file and read that file back on another machine. That pair of commands - export on the old PC, import on the new one - is the closest thing Windows has to a one-command setup. This guide covers the clean workflow, how to trim the file, and how to wrap it in a batch file so the whole setup starts with a double-click.

apps.json - a winget export file (shortened example)

{ "Sources": [ { "Packages": [

{ "PackageIdentifier": "Google.Chrome" }browser
{ "PackageIdentifier": "VideoLAN.VLC" }player
{ "PackageIdentifier": "7zip.7zip" }utility

] } ] }

Example only. The real file is plain text - open it in Notepad and delete any app you do not want on the new PC.

The export file is ordinary JSON - you can read and edit it before importing
1

Export the App List From the Working PC

  1. On the PC that already has everything set up, open Windows Terminal
  2. Run winget export -o C:\Setup\apps.json (create the folder first, or use your Desktop path)
  3. Winget writes every package it manages into the file and tells you about any installed app it could not match to the catalogue - those few you still install by hand
  4. Copy apps.json to a pen drive or your cloud folder - it is tiny
2

Clean the File Before You Reuse It

  1. Open the JSON in Notepad. Each app is one PackageIdentifier line
  2. Delete lines for junk that crept onto the old PC - old tools, trials, the printer utility you no longer need
  3. Keep the structure exactly as exported; only remove whole package entries
  4. Save a master copy as your office standard - every new PC then starts identical
3

Import on the New PC With One Command

  1. On the fresh PC, finish Windows setup and connect to the internet
  2. Run winget import -i C:\Setup\apps.json --accept-package-agreements --accept-source-agreements --ignore-unavailable
  3. --ignore-unavailable lets the import continue past any package that has been removed from the catalogue instead of stopping the whole run
  4. Apps that are already present are skipped or upgraded - nothing breaks if you run import twice
4

Wrap It in a Batch File for a True One Click ⭐

  1. Create setup.bat next to apps.json containing one line: winget import -i "%~dp0apps.json" --accept-package-agreements --accept-source-agreements --ignore-unavailable
  2. %~dp0 means "the folder this batch file is in", so the pair works from any pen drive letter
  3. Right-click the batch file and Run as administrator on each new PC - that is the entire setup routine

Keep the pair on your toolkit pen drive and update the export every few months as your standard app set changes.

⚠️ Honest limits: export and import move app installations only - not app settings, licences, browser profiles or documents. Paid software still needs its licence key afterwards, and apps that were never in the winget catalogue are simply absent from the file.

🎥 Watch the Full Comparison

The video builds this exact export-import setup live and times it against installing the same apps by hand.

▶️ Watch Full Video
❓ Frequently Asked Questions

Can I pin exact app versions in the import file?

By default import installs the latest version of each package. For most office apps latest is what you want. If one app must stay on a specific version, remove it from the JSON and install it separately with winget install --id --version.

The import stopped on one package. What now?

Re-run with --ignore-unavailable so unavailable packages are skipped instead of halting the import, then check the on-screen summary for which package failed and install that one manually.

Does this work between Windows 10 and Windows 11?

Yes. The JSON is just a list of package IDs, and winget exists on both. The same master file can set up a mixed office.

This guide is based on the Technical Anshu video on automatic software installation • Stuck on a step? Ask in the video comments and you will get a reply 🙏