-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHelpdesk-Tools.cmd
More file actions
1804 lines (1622 loc) · 62.8 KB
/
Helpdesk-Tools.cmd
File metadata and controls
1804 lines (1622 loc) · 62.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
echo off
Title Script Auto install Software
:: Check for /test or /test:<Label> argument
if /i "%~1:~0,5"=="/test" (
for /f "tokens=1,2 delims=:" %%a in ("%~1") do (
if /i "%%a"=="/test" (
if not "%%b"=="" goto %%b
goto MainMenu
)
)
)
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo Run CMD as Administrator...
goto goUAC
) else (
goto goADMIN )
REM Go UAC to get Admin privileges
:goUAC
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:goADMIN
pushd "%CD%"
CD /D "%~dp0"
REM ========================================================================================================================================
:MainMenu
@echo off
set "appversion=v0.6.80 Feb 15, 2025"
set "dp=%~dp0"
set "sys32=%windir%\system32"
call :getOfficePath
set officePath=%cd%
set "startProgram=%ProgramData%\Microsoft\Windows\Start Menu\Programs"
cd /d "%dp%"
cls
setlocal
title Main Menu
echo.
echo %appversion%
echo ========================================================
echo [1] Install All In One Online : Press 1
echo [2] Windows Office Utilities : Press 2
echo [3] Active Licenses : Press 3
echo [4] Utilities : Press 4
echo [5] Package Management : Press 5
echo [6] Update CMD : Press 6
echo [7] Exit : Press 7
::echo [8] Test : Press 8
echo ========================================================
if /i "%~1"=="/test" goto :EOF
Choice /N /C 123456 /M " Press your choice : "
if %ERRORLEVEL% == 6 goto :OfficeWindowsMenu
if %ERRORLEVEL% == 5 call :downloadOffice & "%temp%\Office Tool\Office Tool Plus.exe" & goto OfficeWindowsMenu
if %ERRORLEVEL% == 4 set "office=2019"& set "office_type=Volume"& call :defineOffice& goto :OfficeWindowsMenu
if %ERRORLEVEL% == 3 set "office=2021"& set "office_type=Volume"& call :defineOffice& goto :OfficeWindowsMenu
if %ERRORLEVEL% == 2 set "office=2024"& set "office_type=Volume"& call :defineOffice& goto :OfficeWindowsMenu
if %ERRORLEVEL% == 1 set "office=365"& call :installO365& goto :OfficeWindowsMenu
if %ERRORLEVEL% == 2 goto OfficeWindowsMenu
if %ERRORLEVEL% == 1 goto InstallMenu
endlocal
goto exitScript
REM ========================================================================================================================================
REM ==============================================================================
REM Start of installAIOMenu
REM Install Software Online using Winget or Chocolatey
:InstallMenu
setlocal
cls
title Install All In One Online
echo.
echo ======================================================
echo [1] Fresh Install without Office : Press 1
echo [2] Fresh Install with Office 2024 : Press 2
echo [3] Fresh Install with Office 2021 : Press 3
echo [4] Fresh Install with Office 2019 : Press 4
echo [5] Main Menu : Press 5
echo ======================================================
if /i "%~1"=="/test" goto :EOF
choice /n /c 12345 /M "Press your choice: "
if errorlevel 5 goto MainMenu
if errorlevel 4 goto installAioWithOffice2019
if errorlevel 3 goto installAioWithOffice2021
if errorlevel 2 goto installAioWithOffice2024
if errorlevel 1 goto installAioFresh
echo Invalid selection. Please try again.
pause >nul
endlocal
goto InstallMenu
REM ========================================================================================================================================
REM function install fresh Windows using Winget utilities
:installAio
Title Install All in One
cls
call :checkCompatibility
call :applyWindowsSettings
call :setHighPerformance
call :installEndUserApps
call :installChatApps
call :installRemoteApps
call :installUnikey
call :createShortcutss
call :installSupportAssistant
call :debloat
goto :EOF
:installAioFresh
call :installAio
call :Clean
goto :InstallMenu
:installAioWithOffice2019
Title Install All in One with Office 2019
call :installAio
set opt5=(NO)
set opt6=(NO)
set opt7=(NO)
set opt8=(NO)
set opt9=(NO)
set optP=(NO)
set optD=(NO)
set optS=(NO)
set office=2019
set office_type=Volume
call :installOffice
goto :installAIOMenu
:installAioWithOffice2021
Title Install All in One with Office 2021
call :installAio
set opt5=(NO)
set opt6=(NO)
set opt7=(NO)
set opt8=(NO)
set opt9=(NO)
set optP=(NO)
set optD=(NO)
set optS=(NO)
set office=2021
set office_type=Volume
call :installOffice
goto :installAIOMenu
:installAioWithOffice2024
Title Install All in One with Office 2024
call :installAio
set opt5=(NO)
set opt6=(NO)
set opt7=(NO)
set opt8=(NO)
set opt9=(NO)
set optP=(NO)
set optD=(NO)
set optS=(NO)
set office=2024
set office_type=Volume
call :installOffice
goto :installAIOMenu
:installAioSystemNetwork
call :notifyUnderConstruction
goto :installAIOMenu
:installAioHelpdesk
call :notifyUnderConstruction
goto :installAIOMenu
REM End of Install AIO Online
::========================================================================================================================================
::==============================================================================
:: Start of Windows Office Utilities Menu
:displayOfficeWindowsMenu
cls
title Windows Office Main Menu
echo.
echo ==============================================================
echo [1] Install Office Online : Press 1
echo [2] Uninstall Office : Press 2
echo [3] Remove Office Key : Press 3
echo [4] Convert Office Retail ^<==^> Volume License : Press 4
echo [5] Fix Noncore Windows : Press 5
echo [6] Load SKUS Windows : Press 6
echo [7] Main Menu : Press 7
echo ==============================================================
goto :eof
:OfficeWindowsMenu
setlocal
cd /d %dp%
call :displayOfficeWindowsMenu
if /i "%~1"=="/test" goto :EOF
Choice /N /C 1234567 /M " Press your choice : "
if %ERRORLEVEL% == 7 goto :MainMenu
if %ERRORLEVEL% == 6 call :LoadSkusMenu & goto :OfficeWindowsMenu
if %ERRORLEVEL% == 6 call :LoadSkusMenu & goto :OfficeWindowsMenu
if %ERRORLEVEL% == 5 goto :fixNonCore
if %ERRORLEVEL% == 4 goto :convertOfficeEdition
if %ERRORLEVEL% == 3 goto :RemoveOfficeKeyMenu
if %ERRORLEVEL% == 2 goto :UninstallOfficeMenu
if %ERRORLEVEL% == 1 goto :installOfficeMenu
endlocal
REM ==============================================================================
REM Start of Windows Office Utilities functions
REM ==============================================================================
REM Sub menu Install Office Online
:displayInstallOfficeMenu
Title Install Office Online
cls
echo.
echo Select Office Version to Install
echo ================================================================
echo [1] Office 365 : Press 1
echo [2] Office 2024 (PerpetualVL) : Press 2
echo [3] Office 2021 (PerpetualVL) : Press 3
echo [4] Office 2019 (PerpetualVL) : Press 4
echo [5] Install Manually using Office Deploy Tool : Press 5
echo [6] Main Menu : Press 6
echo ================================================================
goto :eof
:installOfficeMenu
setlocal
call :displayInstallOfficeMenu
if /i "%~1"=="/test" goto :EOF
Choice /N /C 123456 /M " Press your choice : "
if %ERRORLEVEL% == 6 goto :OfficeWindowsMenu
if %ERRORLEVEL% == 5 call :downloadOffice & "%temp%\Office Tool\Office Tool Plus.exe" & goto OfficeWindowsMenu
if %ERRORLEVEL% == 4 set "office=2019"& set "office_type=Volume"& call :defineOffice& goto :OfficeWindowsMenu
if %ERRORLEVEL% == 3 set "office=2021"& set "office_type=Volume"& call :defineOffice& goto :OfficeWindowsMenu
if %ERRORLEVEL% == 2 set "office=2024"& set "office_type=Volume"& call :defineOffice& goto :OfficeWindowsMenu
if %ERRORLEVEL% == 1 set "office=365"& call :installO365& goto :OfficeWindowsMenu
endlocal
REM ============================================
REM Stat of install office online
:: Downloads the Office Tool Plus runtime and extracts it.
:: Uses aria2c for download if available, otherwise falls back to curl.
:downloadOffice
cls
pushd %temp%
:: Determine system architecture.
set "arch=x64"
if /I "%PROCESSOR_ARCHITECTURE%"=="x86" set "arch=x86"
if /I "%PROCESSOR_ARCHITECTURE%"=="AMD64" set "arch=x64"
if /I "%PROCESSOR_ARCHITECTURE%"=="ARM64" set "arch=arm64"
echo [*] Detected Architecture: %arch%
:: Construct the download URL.
set "downloadURL=https://otp.landian.vip/redirect/download.php?type=runtime&arch=%arch%&site=github"
:: Download using aria2c if available, otherwise use curl.
where aria2c >nul 2>&1
if %ERRORLEVEL%==0 (
echo [*] Using aria2c for download...
aria2c -x 16 -c -V -o Office-Tool.zip "%downloadURL%"
) else (
echo [*] aria2c not found. Using curl for download...
curl -fsSL -o Office-Tool.zip "%downloadURL%"
)
cls
call :extractZip "Office-Tool.zip" "%temp%" :: Use :extractZip
popd
goto :EOF
:: REF code http://zone94.com/downloads/135-windows-and-office-activation-script
:: Function defines a list of variable representing for Office apps
:defineOffice
cls
@echo off
cd /d "%dp%"
:: set app id
Set "on=(YES)"
Set "off=(NO)"
Set "opt1=%on%" ::Word
Set "opt2=%on%" ::Excel
Set "opt3=%on%" ::PowerPoint
Set "opt4=%on%" ::Outlook
Set "opt5=%on%" ::OneNote
Set "opt6=%on%" ::Publisher
Set "opt7=%on%" ::Access
Set "opt8=%on%" ::OneDrive
Set "opt9=%on%" ::VisioPro2021Retail
Set "optP=%on%" ::ProjectPro2021Retail
Set "optD=%on%" ::ProofingTools
goto :SelectOfficeApp
:: Function menu select app to install. Default is yes with Yes colored green.
:SelectOfficeApp
cls
@echo off
echo.
echo List of components to install Office %office%
<NUL Set/P=[1] & (if "%opt1%"=="%on%" (Call :setColor "%opt1%" 0a) Else (<NUL Set/P="%opt1%")) & echo Microsoft Office Word.
<NUL Set/P=[2] & (if "%opt2%"=="%on%" (Call :setColor "%opt2%" 0a) Else (<NUL Set/P="%opt2%")) & echo Microsoft Office Excel.
<NUL Set/P=[3] & (if "%opt3%"=="%on%" (Call :setColor "%opt3%" 0a) Else (<NUL Set/P="%opt3%")) & echo Microsoft Office PowerPoint.
<NUL Set/P=[4] & (if "%opt4%"=="%on%" (Call :setColor "%opt4%" 0a) Else (<NUL Set/P="%opt4%")) & echo Microsoft Office Outlook.
<NUL Set/P=[5] & (if "%opt5%"=="%on%" (Call :setColor "%opt5%" 0a) Else (<NUL Set/P="%opt5%")) & echo Microsoft Office OneNote.
<NUL Set/P=[6] & (if "%opt6%"=="%on%" (Call :setColor "%opt6%" 0a) Else (<NUL Set/P="%opt6%")) & echo Microsoft Office Publisher.
<NUL Set/P=[7] & (if "%opt7%"=="%on%" (Call :setColor "%opt7%" 0a) Else (<NUL Set/P="%opt7%")) & echo Microsoft Office Access.
<NUL Set/P=[8] & (if "%opt8%"=="%on%" (Call :setColor "%opt8%" 0a) Else (<NUL Set/P="%opt8%")) & echo Microsoft Office Visio.
<NUL Set/P=[9] & (if "%opt9%"=="%on%" (Call :setColor "%opt9%" 0a) Else (<NUL Set/P="%opt9%")) & echo Microsoft Office Project.
<NUL Set/P=[P] & (if "%optP%"=="%on%" (Call :setColor "%optP%" 0a) Else (<NUL Set/P="%optP%")) & echo Microsoft Office Proofing Tools.
<NUL Set/P=[D] & (if "%optD%"=="%on%" (Call :setColor "%optD%" 0a) Else (<NUL Set/P="%optD%")) & echo Microsoft OneDrive Desktop.
<NUL Set/P=[S] & (if "%optS%"=="%on%" (Call :setColor "%optS%" 0a) Else (<NUL Set/P="%optS%")) & echo Microsoft Skype.
<NUL Set/P=[Q] & echo Quit to Office Menu
echo.
if /i "%~1"=="/test" goto :EOF
CHOICE /c 123456789PDSXQ /n /m "--> Select option(s) and then press [X] to start the installation: "
if %ERRORLEVEL% == 14 goto :installOfficeMenu
if %ERRORLEVEL% == 13 goto :installOffice
if %ERRORLEVEL% == 12 (if "%optS%"=="%off%" (Set "optS=%on%") Else (Set "optS=%off%")) & goto :selectOfficeApp
if %ERRORLEVEL% == 11 (if "%optD%"=="%off%" (Set "optD=%on%") Else (Set "optD=%off%")) & goto :selectOfficeApp
if %ERRORLEVEL% == 10 (if "%optP%"=="%on%" (Set "optP=%off%") Else (Set "optP=%on%")) & goto :selectOfficeApp
if %ERRORLEVEL% == 9 (if "%opt9%"=="%on%" (Set "opt9=%off%") Else (Set "opt9=%on%")) & goto :selectOfficeApp
if %ERRORLEVEL% == 8 (if "%opt8%"=="%on%" (Set "opt8=%off%") Else (Set "opt8=%on%")) & goto :selectOfficeApp
if %ERRORLEVEL% == 7 (if "%opt7%"=="%on%" (Set "opt7=%off%") Else (Set "opt7=%on%")) & goto :selectOfficeApp
if %ERRORLEVEL% == 6 (if "%opt6%"=="%on%" (Set "opt6=%off%") Else (Set "opt6=%on%")) & goto :selectOfficeApp
if %ERRORLEVEL% == 5 (if "%opt5%"=="%on%" (Set "opt5=%off%") Else (Set "opt5=%on%")) & goto :selectOfficeApp
if %ERRORLEVEL% == 4 (if "%opt4%"=="%on%" (Set "opt4=%off%") Else (Set "opt4=%on%")) & goto :selectOfficeApp
if %ERRORLEVEL% == 3 (if "%opt3%"=="%on%" (Set "opt3=%off%") Else (Set "opt3=%on%")) & goto :selectOfficeApp
if %ERRORLEVEL% == 2 (if "%opt2%"=="%on%" (Set "opt2=%off%") Else (Set "opt2=%on%")) & goto :selectOfficeApp
if %ERRORLEVEL% == 1 (if "%opt1%"=="%on%" (Set "opt1=%off%") Else (Set "opt1=%on%")) & goto :selectOfficeApp
::
:: Function that help colorized selection menu
:setColor (Text, Color)
REM Function that will colored text with Green = 0a
MkDir "%Temp%\_%1" 1>NUL
PushD "%Temp%\_%1"
For /f %%a in ('Echo PROMPT $H ^| "CMD.exe"') do Set "bs=%%a"
<NUL Set /P="_" >"%1"
FindStr /s /b /p /a:%2 /C:"_" "%1"
<NUL Set /P=%bs%%bs%
PopD
RmDir /s /q "%Temp%\_%1"
GoTo :EOF
:: New function install office using OT
:installOffice
::https://github.com/YerongAI/Office-Tool
Title Install Office by Office-Tool
@echo off
pushd %temp%
call :downloadOffice
SETLOCAL
:: define channel
set "channel=Current"
if %office% == 2019 (set "channel=PerpetualVL2019")
if %office% == 2021 (set "channel=PerpetualVL2021")
if %office% == 2024 (set "channel=PerpetualVL2024")
:: set version Architecture
IF "%Processor_Architecture%"=="AMD64" Set "CPU=64"
IF "%Processor_Architecture%"=="x86" Set "CPU=32"
:: define exclude apps list
Set "exclapps="
if "%opt1%"=="(NO)" (if not defined exclapps (Set "exclapps=Word") else (Set "exclapps=%exclapps%,Word"))
if "%opt2%"=="(NO)" (if not defined exclapps (Set "exclapps=Excel") else (Set "exclapps=%exclapps%,Excel"))
if "%opt3%"=="(NO)" (if not defined exclapps (Set "exclapps=PowerPoint") else (Set "exclapps=%exclapps%,PowerPoint"))
if "%opt4%"=="(NO)" (if not defined exclapps (Set "exclapps=Outlook") else (Set "exclapps=%exclapps%,Outlook"))
if "%opt5%"=="(NO)" (if not defined exclapps (Set "exclapps=OneNote") else (Set "exclapps=%exclapps%,OneNote"))
if "%opt6%"=="(NO)" (if not defined exclapps (Set "exclapps=Publisher") else (Set "exclapps=%exclapps%,Publisher"))
if "%opt7%"=="(NO)" (if not defined exclapps (Set "exclapps=Access") else (Set "exclapps=%exclapps%,Access"))
if "%opt8%"=="(NO)" (if not defined exclapps (Set "exclapps=Visio") else (Set "exclapps=%exclapps%,Visio"))
if "%opt9%"=="(NO)" (if not defined exclapps (Set "exclapps=Project") else (Set "exclapps=%exclapps%,Project"))
if "%optP%"=="(NO)" (if not defined exclapps (Set "exclapps=ProofingTools") else (Set "exclapps=%exclapps%,ProofingTools"))
if "%optD%"=="(NO)" (if not defined exclapps (Set "exclapps=OneDrive,Groove") else (Set "exclapps=%exclapps%,OneDrive,Groove"))
if "%optS%"=="(NO)" (if not defined exclapps (Set "exclapps=Skype,Lync") else (Set "exclapps=%exclapps%,Skype,Lync"))
cls
::"Office Tool\Office Tool Plus.Console.exe" deploy /add ProPlus%office%%office_type%_en-us /ProPlus%office%%office_type%.exclapps %exclapps% /edition %CPU% /acpteula
"Office Tool\Office Tool Plus.Console.exe" deploy /add ProPlus%office%%office_type%_en-us /ProPlus%office%%office_type%.exclapps %exclapps% /edition %CPU% /channel %channel% /acpteula
ENDLOCAL
popd
goto :EOF
:: Function thats help install Office 365
:: Installs Office 365 using the Office Deployment Tool.
:installO365
cls
call :checkCompatibility :: Ensure 7-Zip is available
pushd %temp%
:: Fix URL download Office Deployment Tools
rem curl -o "officedeploymenttool.exe" -fsSL https://download.microsoft.com/download/2/7/A/27AF1BE6-DD20-4CB4-B154-EBAB8A7D4A7E/officedeploymenttool_16501-20196.exe
curl -O -fsSL https://github.com/tamld/cmdToolForHelpdesk/raw/main/officedeploymenttool.exe
call :extractZip "officedeploymenttool.exe" "%temp%"
IF "%Processor_Architecture%"=="AMD64" Set "CPU=x64"
IF "%Processor_Architecture%"=="x86" Set "CPU=x32"
cls
echo Installing Microsoft Office 365 %CPU%-bit
echo Don't close this window until the installation process is completed
ping -n 2 localhost 1>NUL
START "" /WAIT /B "setup.exe" /configure configuration-Office365-%CPU%.xml
popd
cd %dp%
goto :EOF
REM ============================================
:: Function defines which Office (x64/x86) is installed
:getOfficePath
cls
echo off
for %%a in (4,5,6) do (if exist "%ProgramFiles%\Microsoft Office\Office1%%a\ospp.vbs" (cd /d "%ProgramFiles%\Microsoft Office\Office1%%a"&& set officePath=%cd%)
if exist "%ProgramFiles(x86)%\Microsoft Office\Office1%%a\ospp.vbs" (cd /d "%ProgramFiles(x86)%\Microsoft Office\Office1%%a"&& set officePath=%cd%))
goto :eof
:: Function Menu that selects which edition Windows will convert to
:displayLoadSkusMenu
cls
Title Load Windows Eddition
echo.
echo Select Windows Skus edition to convert
echo.
echo ==================================================
echo [1] Professional : PRESS 1
echo [2] ProfessionalWorkstation : PRESS 2
echo [3] Enterprise : PRESS 3
echo [4] EnterpriseS : PRESS 4
echo [5] IoTEnterprise : PRESS 5
echo [6] Education : PRESS 6
echo [7] LTSB 2016 : PRESS 7
echo [8] LTSC 2019 : PRESS 8
echo [9] Menu Active Office : PRESS 9
echo ==================================================
goto :eof
:LoadSkusMenu
setlocal
call :displayLoadSkusMenu
if /i "%~1"=="/test" goto :EOF
Choice /N /C 123456789 /M " Press your choice : "
if %ERRORLEVEL% == 1 set keyW=VK7JG-NPHTM-C97JM-9MPGT-3V66T&& set typeW=Professional&& goto :loadSkus
if %ERRORLEVEL% == 2 set keyW=DXG7C-N36C4-C4HTG-X4T3X-2YV77&& set typeW=ProfessionalWorkstation&& goto :loadSkus
if %ERRORLEVEL% == 3 set keyW=XGVPP-NMH47-7TTHJ-W3FW7-8HV2C&& set typeW=Enterprise&& goto :loadSkus
if %ERRORLEVEL% == 4 set keyW=NK96Y-D9CD8-W44CQ-R8YTK-DYJWX&& set typeW=EnterpriseS&& goto :loadSkus
if %ERRORLEVEL% == 5 set keyW=M7XTQ-FN8P6-TTKYV-9D4CC-J462D&& set typeW=IoTEnterprise&& goto :loadSkus
if %ERRORLEVEL% == 6 set keyW=YNMGQ-8RYV3-4PGQ3-C8XTP-7CFBY&& set typeW=Education&& goto :loadSkus
if %ERRORLEVEL% == 7 set keyW=RW7WN-FMT44-KRGBK-G44WK-QV7YK&& set typeW=wdLTSB2016&& goto :loadSkus
if %ERRORLEVEL% == 8 set keyW=M7XTQ-FN8P6-TTKYV-9D4CC-J462D&& set typeW=wdLTSC2019&& goto :loadSkus
if %ERRORLEVEL% == 9 goto :OfficeWindowsMenu
endlocal
:: Loads a specified Windows SKU (edition) using downloaded license files.
:loadSkus
setlocal
cls
echo off
pushd %temp%
echo.
echo Generic Windows %typeW% key: %keyW%
echo Activating...
if not exist Licenses (
::curl -L -o Licenses.zip https://github.com/tamld/cmdToolForHelpdesk/blob/main/Licenses.zip?raw=true >nul 2>&1
curl -L -o Licenses.zip https://github.com/tamld/cmdToolForHelpdesk/blob/main/packages/Licenses.zip?raw=true >nul 2>&1
call :extractZip "Licenses.zip" "%temp%" :: Use :extractZip
)
xcopy "Licenses\Skus Windows"\%typeW% C:\Windows\system32\spp\tokens\skus\%typeW% /IS /Y >nul 2>&1
ping -n 3 localhost > NUL
popd
pushd c:\Windows\system32
cscript.exe slmgr.vbs /rilc
cscript.exe slmgr.vbs /upk >nul 2>&1
cscript.exe slmgr.vbs /ckms >nul 2>&1
cscript.exe slmgr.vbs /cpky >nul 2>&1
cscript.exe slmgr.vbs /ipk %keyW% >nul 2>&1
sc config LicenseManager start= auto & net start LicenseManager >nul 2>&1
sc config wuauserv start= auto & net start wuauserv >nul 2>&1
clipup -v -o -altto c:\
cls
echo Load Windows eddition %typeW% completed
ping -n 3 localhost 1>NUL
endlocal
goto :EOF
:fixNonCore
cls
call :notifyUnderConstruction
goto :OfficeWindowsMenu
:convertOfficeEdition
call :notifyUnderConstruction
goto :OfficeWindowsMenu
REM ============================================
REM Start of Remove Office Keys
:displayRemoveOfficeKeyMenu
cls
Title Remove Office Key
echo.
echo How would you like to remove the office key?
echo =================================================
echo [1] One by one : Press 1
echo [2] All : Press 2
echo [3] Back to Windows Office Menu : Press 3
echo =================================================
goto :eof
:RemoveOfficeKeyMenu
call :displayRemoveOfficeKeyMenu
if /i "%~1"=="/test" goto :EOF
Choice /N /C 123 /M " Press your choice : "
if %ERRORLEVEL% == 3 goto :OfficeWindowsMenu
if %ERRORLEVEL% == 2 call :removeOfficeKeyAll & goto :OfficeWindowsMenu
if %ERRORLEVEL% == 1 call :removeOfficeKeyOneByOne & goto :OfficeWindowsMenu
:removeOfficeKeyOneByOne
cls
setlocal
pushd %officePath%
echo Your office path at: %officePath%
echo.
::Get input from user
set /p key=Write down/Paste 5 letters key need to uninstall:
::Loop through the OSPP.VBS file and find the key to uninstall
for /f "tokens=8" %%b in ('findstr /b /c:"%key%" OSPP.VBS') do (
cscript //nologo ospp.vbs /unpkey:%%b
endlocal
popd
ping -n 2 localhost 1>NUL
goto :eof
:removeOfficeKeyAll
echo off
cls
setlocal
rem cd /d %officePath%
pushd %officePath%
echo Your office path at: %officePath%
for /f "tokens=8" %%b in ('findstr /b /c:"Last 5" OSPP.VBS') do (
cscript //nologo ospp.vbs /unpkey:%%b
echo Key %%b has been removed
)
endlocal
ping -n 2 localhost 1>NUL
goto :eof
:UninstallOfficeMenu
call :displayUninstallOfficeMenu
if /i "%~1"=="/test" goto :EOF
Choice /N /C 1234 /M " Press your choice : "
if %ERRORLEVEL% == 4 goto :OfficeWindowsMenu
if %ERRORLEVEL% == 3 goto :removeOfficeWithBCUninstaller
if %ERRORLEVEL% == 2 goto :removeOfficeWithOfficeTool
if %ERRORLEVEL% == 1 goto :removeOfficeWithSaraCmd
:displayUninstallOfficeMenu
cls
Title Uninstall Office all versions
echo.
echo ====================================================
echo [1] Using SaraCMD (silent) : Press 1
echo [2] Using Office Tool Plus : Press 2
echo [3] Using BCUninstaller : Press 3
echo [4] Back to Windows Office Menu : Press 4
echo ====================================================
goto :eof
:removeOfficeWithBCUninstaller
cls
Title Uninstall Office Using BulkCrapUninstaller
echo This will install BCUninstaller into your computer
call :checkCompatibility
call :installSoft_ByWinget Klocman.BulkCrapUninstaller
call :bcuninstaller-Settings
goto :OfficeWindowsMenu
:removeOfficeWithOfficeTool
Title Uninstall Office Using Office Tool
cls
pushd %temp%
call :downloadOffice
cls
echo This script will uninstall your Office installation using the Office Tool.
echo Please wait until the wizard has completed the uninstallation process
ping -n 3 localhost > nul
"Office Tool\Office Tool Plus.Console.exe" deploy /rmall /acpteula
goto :OfficeWindowsMenu
:removeOfficeWithSaraUI
Title Uninstall Office Using Office Tool
cls
Title Uninstall Office Using Sara UI
echo This will download (browser download) and install Sara UI for uninstalling Office steps
echo You must install it manually and follow the wizard guide
ping -n 4 localhost 1>NUL
start https://aka.ms/SaRA-officeUninstallFromPC
goto :OfficeWindowsMenu
:: Uninstalls Office completely using the SaRA command-line tool.
:removeOfficeWithSaraCmd
Title Uninstall office completely using Sara Cmd
cls
echo This will download and remove office without interactive
ping -n 2 localhost 1>NUL
cls
echo off
pushd %temp%
curl -# -o SaRACmd.zip -fsL https://aka.ms/SaRA_CommandLineVersionFiles
call :extractZip "SaRACmd.zip" "SaRACmd" :: Use :extractZip
cls
echo Start to uninstall office via SaRACmd
echo It could took a while, please wait to end
ping -n 2 localhost 1>NUL
cls
SaRACmd\SaRAcmd.exe -S OfficeScrubScenario -AcceptEula
popd
cd /d %dp%
cls
goto :OfficeWindowsMenu
REM End of Remove Office Keys
REM ============================================
REM End of Windows Office Utilities functions
REM ========================================================================================================================================
:displayActiveLicensesMenu
echo.
echo ========================================================
echo [1] Online : Press 1
echo [2] By Phone : Press 2
echo [3] Check Licenses : Press 3
echo [4] Backup Licenses : Press 4
echo [5] Restore License : Press 5
echo [6] MAS (Microsoft Activation Scripts) : Press 6
echo [7] Back to Main Menu : Press 7
echo ========================================================
goto :eof
:ActiveLicensesMenu
REM Start of Active Licenses Menu
setlocal
Title Active Licenses Menu
cls
call :displayActiveLicensesMenu
if /i "%~1"=="/test" goto :EOF
Choice /N /C 1234567 /M " Press your choice : "
if %ERRORLEVEL% == 7 goto :MainMenu
if %ERRORLEVEL% == 6 goto :runMicrosoftActivationScripts
if %ERRORLEVEL% == 5 goto :restoreLicenses
if %ERRORLEVEL% == 4 goto :BackupLicensesMenu
if %ERRORLEVEL% == 3 goto :checkLicense
if %ERRORLEVEL% == 2 goto :activeByPhone
if %ERRORLEVEL% == 1 goto :activeOnline
endlocal
REM End of Active Licenses Menu
REM ==============================================================================
::@ Start of Active Lienses functions
:runMicrosoftActivationScripts
cls
REM call :notifyUnderConstruction
pushd %temp%
start powershell.exe -command "irm https://get.activated.win | iex"
popd
cd %dp%
cls
goto :activeLicenses
:restoreLicenses
cls
call :notifyUnderConstruction
goto :activeLicenses
REM ============================================
REM Start of Backup License Windows & Office
:displayBackupLicensesMenu
Title Backup License Windows ^& Office
echo.
echo =================================================
echo [1] BACKUP To Local : Press 1
echo [2] BACKUP To NAS STORAGE : Press 2
echo [3] Back to Main Menu : Press 3
echo =================================================
goto :eof
:BackupLicensesMenu
cls
call :displayBackupLicensesMenu
if /i "%~1"=="/test" goto :EOF
Choice /N /C 123 /M " Press your choice : "
if %ERRORLEVEL% == 3 goto :ActiveLicensesMenu
if %ERRORLEVEL% == 2 goto :backupToNas
if %ERRORLEVEL% == 1 goto :backupToLocal
:backupToNas
call :notifyUnderConstruction
goto :backupLicenses
:backupToLocal
call :notifyUnderConstruction
goto :backupLicenses
REM End of Backup License Windows & Office
REM ============================================
:checkLicense
cls
call :notifyUnderConstruction
goto :activeLicenses
:activeByPhone
cls
call :notifyUnderConstruction
goto :activeLicenses
:activeOnline
cls
call :notifyUnderConstruction
goto :activeLicenses
REM End of Active Lienses functions
REM ========================================================================================================================================
:displayUtilitiesMenu
echo.
echo =================================================
echo [1] Set High Performance : Press 1
echo [2] Change hostname : Press 2
echo [3] Clean up system : Press 3
echo [4] ChrisTitusTech/winutil : Press 4
echo [5] Install Support Assistance : Press 5
echo [6] Active IDM : Press 6
echo [7] Windows Debloat : Press 7
echo [8] Back to Main Menu : Press 8
echo =================================================
goto :eof
:UtilitiesMenu
setlocal
REM Start of Utilities Menu
cls
title Utilities Main Menu
call :displayUtilitiesMenu
if /i "%~1"=="/test" goto :EOF
Choice /N /C 12345678 /M " Press your choice : "
if %ERRORLEVEL% == 8 goto :MainMenu
if %ERRORLEVEL% == 7 goto :debloat & goto :utilities
if %ERRORLEVEL% == 6 call :activeIDM & goto :utilities
if %ERRORLEVEL% == 5 goto :installSupportAssistant
if %ERRORLEVEL% == 4 call :runWinUtil & goto :utilities
if %ERRORLEVEL% == 3 goto :cleanUpSystem & goto :utilities
if %ERRORLEVEL% == 2 goto :changeHostName & goto :utilities
if %ERRORLEVEL% == 1 goto :setHighPerformance & goto :utilities
endlocal
REM End of Utilities Menu
REM ==============================================================================
REM Start of Utilities functions
:runWinUtil
:: call https://github.com/ChrisTitusTech/winutil Powershell
start powershell -command "irm "https://christitus.com/win" | iex"
goto :EOF
:debloat
TITLE Windows Debloat
echo Remove Unused Packages, Bloatwares
echo Winget uninstall debloat packages
call :winget_debloat
cls
echo Powershell uninstall packages
call :windows_debloat
cls
echo Disabled the unnecessary services
call :disable_os_services
goto :EOF
:getUserInformation
Title Get User Information
REM Prompt user for new username
echo Enter new username that you'd like to add:
set /p user=
REM Prompt user to set password or not
:inputPassword
echo Do you want to set a password for %user%? [Y/N]
set /p setpass=
REM Add user with or without password
if /i "%setpass%" == "Y" (
echo %user%'s password is:
set /p _pass=
net user %user% %_pass% /add 2>nul
ping -n 2 localhost 1>NUL
cls
) else if /i "%setpass%" == "N" (
net user %user% "" /add 2>nul
cls
) else (
echo Invalid input. Please try again.
goto :inputPassword
cls
)
goto :EOF
:addUserToAdmins
REM This function adds the user to the Administrators group.
Title Add User to Administrators Group
call :GetUserInformation
net localgroup administrators %user% /add
if %errorlevel% == 0 (
echo User %user% was added to administrators group.
ping -n 2 localhost 1>NUL
cls
) else (
echo Failed to add user %user% to administrators group.
)
cls
goto :utilities
:addUserToUsers
REM This function adds the user to the Users group.
Title Add User to Users Group
call :GetUserInformation
echo User %user% was added to users group.
ping -n 2 localhost 1>NUL
cls
goto :utilities
:restartPc
cls
echo This will force restart computer with 5s
shutdown -r -t 5 -f
goto :utilities
:installSupportAssistant
Title Install Support Assistant
call :checkCompatibility
cls
echo Installing Support Assistant
ping -n 3 localhost 1>NUL
setlocal
echo off
REM Detect brand name
for /f %%b in ('wmic computersystem get manufacturer ^| findstr /I "Dell HP Lenovo"') do set "BRAND=%%b"
REM Download and install the appropriate support assistant
if /I "%BRAND%" == "Dell" (
choco install -y supportassist --ignore-checksums
) else if /I "%BRAND%" == "HP" (
choco install -y hpsupportassistant --ignore-checksums
) else if /I "%BRAND%" == "Lenovo" (
choco install -y lenovo-thinkvantage-system-update --ignore-checksums
) else (
echo Unknown brand: %BRAND%
)
endlocal
goto :eof
cd %dp%
goto :utilities
:joinDomain
cls
setlocal
REM input Fully Qualified Domain Name
set /p server=Enter the Domain Name:
REM check if host can reach the AD with FQDN
ping %server%
REM ping -n 4 %server% 1>NUL
if %errorlevel% neq 0 (
echo Cannot reach server. Exiting...
ping -n 5 localhost 1>NUL
) else (
echo %server% is pingable. Proceeding with upgrade...
ping -n 5 localhost 1>NUL
cls
echo Please enter FQDN username instead of username only (domain\username instead of username)
call :inputCredential
echo Joining domain...
wmic computersystem where name="%computername%" call joindomainorworkgroup name=%server% username=%username% password=%password%
if %errorlevel% neq 0 (
cls
echo Failed to join domain. Error code: %errorlevel%
ping -n 5 localhost 1>NUL
) else (
cls
echo Successfully joined domain.
)
ping -n 5 localhost 1>NUL
endlocal
goto :utilities
REM This function will use Windows Disk Cleanup to remove unnecessary files
:cleanUpSystem
Title Clean Up System
cls
echo This will cleanup temp folder and add preset for Windows Cleanup Utilities
echo You can execute the command cleanmgr /sagerun:1 afterward
call :cleanTemp > NUL
ping -n 3 localhost > NUL
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active Setup Temp Folders" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\BranchCache" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\D3D Shader Cache" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Delivery Optimization Files" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Diagnostic Data Viewer database files" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Downloaded Program Files" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Internet Cache Files" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Feedback Hub Archive log files" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Language Pack" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Old ChkDsk Files" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Recycle Bin" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\RetailDemo Offline Content" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Setup Log Files" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\System error memory dump files" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\System error minidump files" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Files" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Thumbnail Cache" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Update Cleanup" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\User file versions" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Defender" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting Files" /v StateFlags0001 /t REG_DWORD /d 00000002 /f
cls
cleanmgr /sagerun:1
goto :utilities
:changeHostName
Title Change host name
setlocal EnableDelayedExpansion
cls
echo Your new computername is:
set /p _newComputername=
cls
echo This will change your computername from: %computername% to: %_newComputername%
ping -n 2 localhost 1>NUL
WMIC ComputerSystem where Name="%computername%" call Rename Name="%_newComputername%"
for /f "skip=1 tokens=2 delims==; " %%i in ('WMIC ComputerSystem where Name^="%computername%" call Rename Name^="%_newComputername%" ^| findstr "ReturnValue ="') do set _statusChangeHostName=%%i
cls
if %_statusChangeHostName% == 0 (
echo Your computername will change to %_newComputername%
echo Restart computer to apply the change
ping -n 3 localhost 1>NUL
cls
)
if %_statusChangeHostName% NEQ 0 (
echo Your computer name will not change
echo Try a name without containing special characters like ^~, ^!, ^@.....
echo Do you want to change your computer hostname again^?
Choice /N /C YN /M "[Yes], [No]: "
If ERRORLEVEL == Y goto :changeHostName
)
endlocal
goto :utilities
:applyWindowsSettings
cls
echo off
echo Setting OS
echo Hide Search Menu Bar
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f >nul
:: Turn off News and Interests
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds" /v "ShellFeedsTaskbarViewMode" /t REG_DWORD /d 2 /f >nul
:: Use Small Taskbar Buttons
::reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarSmallIcons" /t REG_DWORD /d 1 /f >nul
:: Replace Command Prompt with PowerShell in the Menu
::reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "DontUsePowerShellOnWinX" /t REG_DWORD /d 0 /f >nul
echo Show file extension
powershell Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideFileExt -Value 0
echo Enable Dark mode
powershell Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 0
echo Show this PC view
powershell Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1
echo Revert classic menu Right click W11
setlocal
:: Detect Windows 10 or 11
for /f "tokens=2,3 delims= " %%a in ('wmic os get name /value ^| findstr /i "name"') do set winver=%%b
if %winver%==11 (
echo Revert classic menu Right click W11
reg add HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2} /ve /t REG_SZ /d "" /f
reg add HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32 /ve /t REG_SZ /d "" /f
)
endlocal
echo Check for update
wuauclt /detectnow
:: Enable Photoviewer
reg add "HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open" /ve /t REG_SZ /d "@photoviewer.dll,-3043" /f > nul 2>&1
reg add "HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command" /ve /t REG_EXPAND_SZ /d "\"%SystemRoot%\System32\rundll32.exe\" \"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll\", ImageView_Fullscreen %1" /f > nul 2>&1
reg add "HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget" /ve /t REG_SZ /d "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" /f > nul 2>&1
reg add "HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print" /ve /t REG_SZ /d "Print with Windows Photo Viewer" /f > nul 2>&1
reg add "HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\command" /ve /t REG_EXPAND_SZ /d "\"%SystemRoot%\System32\rundll32.exe\" \"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll\", ImageView_PrintTo %1" /f > nul 2>&1
reg add "HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\DropTarget" /ve /t REG_SZ /d "{60fd46de-f830-4894-a628-6fa81bc0190d}" /f > nul 2>&1