Technical Anshu
Tutorials Blog
💾 סקריפט הגדרת מחשב

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
🎥 צפו בכל שלוש השיטות זו לצד זו בסרטון המלא

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)

{ "מקורות": [ { "חבילות": [

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

] } ] }

דוגמה בלבד. The real file is plain text - open it in Notepad and delete any app you do not want on the new PC.

קובץ הייצוא הוא JSON רגיל - ניתן לקרוא ולערוך אותו לפני הייבוא
1

ייצא את רשימת האפליקציות מהמחשב העובד

  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 כותבת כל חבילה שהיא מנהלת לקובץ ומספרת לך על כל אפליקציה מותקנת שהיא לא יכלה להתאים לקטלוג - אלה כמה שאתה עדיין מתקין ביד
  4. Copy apps.json to a pen drive or your cloud folder - it is tiny
2

נקה את הקובץ לפני שתשתמש בו מחדש

  1. פתח את ה-JSON בפנקס הרשימות. כל אפליקציה היא שורה אחת PackageIdentifier
  2. Delete lines for junk that crept onto the old PC - old tools, trials, the printer utility you no longer need
  3. שמור על המבנה בדיוק כפי שיוצא; הסר רק ערכי חבילה שלמות
  4. Save a master copy as your office standard - every new PC then starts identical
3

יבוא למחשב החדש עם פקודה אחת

  1. במחשב הטרי, סיים את הגדרת Windows והתחבר לאינטרנט
  2. הפעל את winget import -i C:\Setup\apps.json --accept-package-agreements --accept-source-agreements --ignore-unavailable
  3. --ignore-unavailable מאפשר לייבוא להמשיך מעבר לכל חבילה שהוסרה מהקטלוג במקום לעצור את כל הריצה
  4. אפליקציות שכבר קיימות מדלגות או משודרגות - שום דבר לא נשבר אם אתה מפעיל ייבוא פעמיים
4

עטפו אותו בקובץ אצווה בקליק אחד אמיתי ⭐

  1. צור setup.bat ליד apps.json המכיל שורה אחת: winget import -i "%~dp0apps.json" --accept-package-agreements --accept-source-agreements --ignore-unavailable
  2. %~dp0 פירושו "התיקייה שבה נמצא קובץ האצווה הזה", כך שהזוג פועל מכל אות כונן עט
  3. לחץ לחיצה ימנית על קובץ האצווה והפעל כמנהל בכל מחשב חדש - זו כל שגרת ההתקנה

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

⚠️ מגבלות כנות: ייצוא ויבוא התקנות העברת אפליקציות בלבד - לא הגדרות אפליקציה, רישיונות, פרופילי דפדפן או מסמכים. תוכנה בתשלום עדיין צריכה את מפתח הרישיון שלה לאחר מכן, ואפליקציות שמעולם לא היו בקטלוג הכנף פשוט נעדרות מהקובץ.

🎥 צפו בהשוואה המלאה

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

▶️ Watch Full Video
❓ שאלות נפוצות

האם אוכל להצמיד גרסאות אפליקציה מדויקות בקובץ הייבוא?

By default import installs the latest version of each package. עבור רוב אפליקציות המשרד העדכנית ביותר היא מה שאתה רוצה. If one app must stay on a specific version, remove it from the JSON and install it separately with winget install --id --version.

הייבוא ​​נעצר על חבילה אחת. מה עכשיו?

הפעל מחדש עם --ignore-unavailable כדי לדלג על חבילות לא זמינות במקום לעצור את הייבוא, ולאחר מכן בדוק את הסיכום שעל המסך עבור איזו חבילה נכשלה והתקן אותה באופן ידני.

האם זה עובד בין Windows 10 ו-Windows 11?

כן. The JSON is just a list of package IDs, and winget exists on both. אותו קובץ מאסטר יכול להגדיר משרד מעורב.

מדריך זה מבוסס על הסרטון Technical Anshu על התקנת תוכנה אוטומטית • נתקעתם על מדרגה? שאלו בתגובות הסרטון ותקבלו תשובה 🙏