Backup and restore using CMD

When buying a new computer or reinstalling a copy of Windows, the first thing we do is reinstall all the programs we use from browsers and media players to chat and communication programs and more. Although there are many tools to download and install all your programs with one click instead of spending a period of your time manually reinstalling each program separately, let's review below a very special method that can be used in Windows to save a copy of the installed programs and restore it again, from Through Command Prompt (CMD) only.

Backup apps

In recent versions of Windows 10 or in Windows 11, there is a very cool tool that Microsoft added called "Windows Package Manager", which allows managing everything related to programs through the command prompt, whether CMD or PowerShell, so that through the [winget] command it is possible to download and install programs on the computer As we explained in detail earlier, in addition to the ability to remove and update programs in bulk, today we explain another function, which is to save a copy of the installed programs to reinstall it on another device or the same device after installing a new copy of Windows.

But keep in mind that this copy does not include your data saved in the programs, it is just a list of the names of the installed programs and is saved in a JSON file that is read later to install these programs once easily, here are the steps below.

Run CMD as administrator

First, launch the Command Prompt in any of the ways we reviewed before, but the easiest way is to press the Win + S (S) keys together on the keyboard to open the search bar and then type “CMD” or “Windows Terminal” (Optional) If you are using Windows 11, then from the search results, click on the “Run as administrator” option to launch the command prompt with administrator privileges.

winget command

After the CMD window appears, type [winget export -o C:\exported.json] and press Enter. Press Enter. Once you do that, the command will create a JSON file called "exported" on Partition C that contains a list of all the programs installed on your machine that can be reinstalled later in one go.

But most of the time, the list will not include all the programs you use. If you look at the list that appears after executing the previous command, you will find all applications and programs that are not included in the JSON file, because the Windows Package Manager function saves only the programs that support them and not all programs designed for Windows. This does not mean that it is a useless function, at all, there are more than 3,700 different programs supported and the number keeps growing, so you are sure to find most of the programs you use on the list.

In case you want to know which programs are saved in the list, you can open the File Explorer tool and head to Partition C, there you will find the “exported.json” file, right-click on it, then hover your mouse pointer over the “Open with” option and select from the drop-down list the “Notepad” application But in the event that Notepad does not appear in the drop-down list, click on the “Choose another app” option and select the application from the pop-up window that appears in front of you. Finally, the contents of the file will be displayed in a new window where you can identify the programs that can be restored later using the Windows Package Manager function.

Now if you want to reinstall the programs again on the same or another device (the JSON file should be transferred to this device and stored in Partition C) open Command Prompt and type the following command and press Enter:

winget import -i C:\exported.json

The command will automatically scan the list in the JSON file and download and install all programs automatically and in complete silence! If a program is already installed, the command will skip installing it, and continue with the rest of the list. As such, you can save and restore a copy of your installed programs, or at least most of them, using only the command prompt.

Popular posts from this blog

LIST OF STOP DJVU Extensions

How to remove syzs_dl_svr.exe error