news

Save and Restore a Copy of Installed Programs on Your Device Using CMD

When buying a new computer or reinstalling Windows, the first thing we do is reinstall all the programs we use, starting from the browser and media players, chat programs, and communication software. While there are many tools available for downloading and installing all your programs with just one click instead of spending time reinstalling each program manually, let’s take a look at a very unique method that can be used in Windows to save a backup of installed programs and restore them using only the Command Prompt (CMD).

In the modern versions of Windows 10 or Windows 11, there is a very cool tool added by Microsoft called “Windows Package Manager” which allows you to manage all aspects of programs through the Command Prompt, whether CMD or PowerShell. Through the [winget] command, you can download and install programs on your computer as we explained in detail earlier, as well as the ability to remove and update programs in bulk. Today, we will explain another function, which is to save a backup of installed programs to reinstall them on another device or the same device after installing a new Windows.
But keep in mind that this list does not include your saved data in the programs, but merely a list of installed programs saved in a JSON file, which can be read later to reinstall these programs all at once easily. Here are the steps:
First, run the Command Prompt in any way we have reviewed before, but the easiest way is to press the Win + S keys together on the keyboard to open the search bar, then type “CMD” or “Windows Terminal” (optional) if you are using Windows 11. From the search results, click on the “Run as administrator” option to run the Command Prompt with admin privileges.
Once the CMD window appears, type the command [winget export -o C:\exported.json] and press Enter. If this is the first time you use the Windows Package Manager function, you will be prompted to agree to the license agreement first by typing the letter “y” to agree and then press Enter. Once you do this, the command will create a JSON file named “exported” on the C partition containing a list of all the installed programs on your computer that can be reinstalled later all at once.
However, the list may not include all the programs you use. If you look at the list that appears after executing the previous command, you will find all the applications and programs that were not included in the JSON file because the Windows Package Manager function saves only the supported programs, not all programs designed for Windows. This does not mean it is a useless function at all. There are more than 3700 different supported programs, and the number continues to increase, so you are likely to find most of the programs you use listed in the menu.
If you want to know which programs were saved in the list specifically, you can open File Explorer and navigate to the C partition where you will find the “exported.json” file. Right-click on it, hover over “Open with,” select “Notepad” from the drop-down list. If Notepad does not appear in the drop-down list, click on “Choose another app” and select the application from the pop-up window. In the end, the contents of the file will be displayed in a new window, through which 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 device or another device (you should transfer the JSON file to that device and store it on the C partition), open the Command Prompt and type the following command, then press Enter:

winget import -i C:\exported.json

The command will automatically check the list in the JSON file and download and install all the programs automatically and silently! If a program is already installed, the command will skip its installation and continue with the rest of the list. This way, you can save and restore a backup of installed programs, or at least most of them, using only the Command Prompt.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
error: Content is protected !!