-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathengineeringDebloat.ps1
More file actions
886 lines (815 loc) · 29.7 KB
/
Copy pathengineeringDebloat.ps1
File metadata and controls
886 lines (815 loc) · 29.7 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
# Complete Engineering Software Uninstaller
# Run this script as Administrator in PowerShell
# This script performs DEEP removal including registry, temp files, and services
#Requires -RunAsAdministrator
param(
[switch]$NonInteractive,
[ValidateSet("All","Autodesk","Vectorworks","Bluebeam","SolidWorks","Bentley","List","Cleanup","Exit")]
[string]$Mode = "Exit",
[switch]$ConfirmRemoval,
[switch]$NoPause
)
Write-Host "Engineering Software Complete Removal Tool" -ForegroundColor Green
Write-Host "=========================================" -ForegroundColor Green
Write-Host ""
# Verify Administrator privileges
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Error "This script requires Administrator privileges. Please run as Administrator."
if (-not $NoPause) {
Pause
}
Exit 1
}
Write-Host "WARNING: This will COMPLETELY remove engineering software and all data!" -ForegroundColor Red
Write-Host "Make sure to backup any important project files first!" -ForegroundColor Yellow
Write-Host ""
# Engineering software to remove - ALL VERSIONS INCLUDED
$EngineeringSoftware = @{
"Autodesk" = @(
# AutoCAD (All Versions)
"AutoCAD*"
"Autodesk AutoCAD*"
"AutoCAD 2024"
"AutoCAD 2023"
"AutoCAD 2022"
"AutoCAD 2021"
"AutoCAD 2020"
"AutoCAD 2019"
"AutoCAD 2018"
"AutoCAD 2017"
"AutoCAD 2016"
"AutoCAD 2015"
"AutoCAD 2014"
"AutoCAD LT*"
"AutoCAD Architecture*"
"AutoCAD Electrical*"
"AutoCAD Mechanical*"
"AutoCAD MEP*"
"AutoCAD Plant 3D*"
"AutoCAD Civil 3D*"
# Civil 3D (All Versions)
"Autodesk Civil 3D*"
"Civil 3D 2024"
"Civil 3D 2023"
"Civil 3D 2022"
"Civil 3D 2021"
"Civil 3D 2020"
"Civil 3D 2019"
"Civil 3D 2018"
"Civil 3D 2017"
# Other Autodesk Products
"Autodesk 3ds Max*"
"Autodesk Maya*"
"Autodesk Inventor*"
"Autodesk Revit*"
"Autodesk Fusion 360*"
"Autodesk Navisworks*"
"Autodesk Vault*"
"Autodesk Robot Structural Analysis*"
"Autodesk Infraworks*"
"Autodesk Advance Steel*"
"Autodesk Alias*"
"Autodesk VRED*"
"Autodesk Moldflow*"
"Autodesk PowerMill*"
"Autodesk FeatureCAM*"
"Autodesk HSMWorks*"
"Autodesk Mudbox*"
"Autodesk MotionBuilder*"
"Autodesk Smoke*"
"Autodesk Flame*"
# Autodesk Supporting Software
"Autodesk Desktop App*"
"Autodesk Application Manager*"
"Autodesk Content Service*"
"Autodesk Material Library*"
"Autodesk Shared*"
"Autodesk DirectConnect*"
"Autodesk ReCap*"
"Autodesk A360*"
"Autodesk Communication Center*"
"Autodesk Network License Manager*"
"Autodesk Backburner*"
"Autodesk FBX*"
"Autodesk DWF Viewer*"
"Autodesk Design Review*"
"Autodesk True View*"
)
"Vectorworks" = @(
# Vectorworks (All Versions)
"Vectorworks*"
"Vectorworks 2024"
"Vectorworks 2023"
"Vectorworks 2022"
"Vectorworks 2021"
"Vectorworks 2020"
"Vectorworks 2019"
"Vectorworks 2018"
"Vectorworks 2017"
"Vectorworks Architect*"
"Vectorworks Landmark*"
"Vectorworks Spotlight*"
"Vectorworks Designer*"
"Vectorworks Fundamentals*"
"Vectorworks Viewer*"
"Vectorworks Cloud Services*"
"Nemetschek Vectorworks*"
)
"Bluebeam" = @(
# Bluebeam Revu (All Versions)
"Bluebeam*"
"Bluebeam Revu*"
"Bluebeam Revu eXtreme*"
"Bluebeam Revu CAD*"
"Bluebeam Revu Standard*"
"Bluebeam Revu 21*"
"Bluebeam Revu 20*"
"Bluebeam Revu 2019*"
"Bluebeam Revu 2018*"
"Bluebeam Revu 2017*"
"Bluebeam Revu 17*"
"Bluebeam Revu 16*"
"Bluebeam PDF Revu*"
"Bluebeam Administrator*"
"Bluebeam Gateway*"
"Bluebeam Studio*"
)
"HydroCad" = @(
# HydroCad (All Versions)
"HydroCAD*"
"HydroCad*"
"HydroCAD Stormwater*"
"HydroCAD"
"Applied Microcomputer Systems*"
)
"BentleyMicrostation" = @(
# Bentley MicroStation and Related
"MicroStation*"
"Bentley MicroStation*"
"Bentley View*"
"Bentley Navigator*"
"Bentley PowerDraft*"
"Bentley AECOsim*"
"Bentley OpenRoads*"
"Bentley OpenRail*"
"Bentley OpenBuildings*"
"Bentley OpenPlant*"
"Bentley STAAD*"
"Bentley RAM*"
"Bentley MAXSURF*"
"Bentley MOSES*"
"Bentley AutoPIPE*"
"Bentley CivilStorm*"
"Bentley SewerGEMS*"
"Bentley WaterGEMS*"
"Bentley HAMMER*"
"Bentley PondPack*"
"Bentley CulvertMaster*"
"Bentley FlowMaster*"
"Bentley LumenRT*"
"Bentley Pointools*"
"Bentley ProjectWise*"
"Bentley AssetWise*"
"Bentley ContextCapture*"
)
"SolidWorks" = @(
# SolidWorks (All Versions)
"SolidWorks*"
"SOLIDWORKS*"
"SolidWorks 2024*"
"SolidWorks 2023*"
"SolidWorks 2022*"
"SolidWorks 2021*"
"SolidWorks 2020*"
"SolidWorks 2019*"
"SolidWorks 2018*"
"SolidWorks Premium*"
"SolidWorks Professional*"
"SolidWorks Standard*"
"SolidWorks Simulation*"
"SolidWorks Flow Simulation*"
"SolidWorks Plastics*"
"SolidWorks Electrical*"
"SolidWorks PDM*"
"SolidWorks Composer*"
"SolidWorks Visualize*"
"SolidWorks CAM*"
"SolidWorks Inspection*"
"SolidWorks MBD*"
"eDrawings*"
"3DEXPERIENCE*"
)
"SketchUp" = @(
# SketchUp (All Versions)
"SketchUp*"
"Google SketchUp*"
"Trimble SketchUp*"
"SketchUp Pro*"
"SketchUp Make*"
"SketchUp Viewer*"
"LayOut*"
"Style Builder*"
)
"Rhino" = @(
# Rhino 3D
"Rhino*"
"Rhinoceros*"
"Rhino 7*"
"Rhino 6*"
"Rhino 5*"
"Grasshopper*"
"RhinoCAM*"
"Brazil for Rhino*"
"Flamingo*"
"Penguin*"
"Bongo*"
)
"ANSYS" = @(
# ANSYS Suite
"ANSYS*"
"Ansys*"
"ANSYS Workbench*"
"ANSYS Fluent*"
"ANSYS CFX*"
"ANSYS Mechanical*"
"ANSYS Electronics*"
"ANSYS HFSS*"
"ANSYS Maxwell*"
"ANSYS Icepak*"
"ANSYS LS-DYNA*"
"ANSYS Discovery*"
"ANSYS SpaceClaim*"
"ANSYS DesignModeler*"
)
"MATLAB" = @(
# MATLAB and Simulink
"MATLAB*"
"Simulink*"
"MathWorks*"
)
"ArcGIS" = @(
# ESRI ArcGIS Suite
"ArcGIS*"
"ArcMap*"
"ArcCatalog*"
"ArcScene*"
"ArcGlobe*"
"ArcGIS Pro*"
"ArcGIS Desktop*"
"ArcReader*"
"ArcGIS Explorer*"
"ESRI*"
)
"ETABS_SAP" = @(
# Structural Analysis Software
"ETABS*"
"SAP2000*"
"CSiBridge*"
"SAFE*"
"Perform-3D*"
"Computers and Structures*"
)
"Tekla" = @(
# Tekla Structures
"Tekla*"
"Tekla Structures*"
"Tekla Warehouse*"
"Tekla Model Sharing*"
"Tekla BIMsight*"
)
"MathCAD" = @(
# PTC Mathcad
"Mathcad*"
"MathCAD*"
"PTC Mathcad*"
"Mathcad Prime*"
)
"Additional" = @(
# Additional Engineering Software
"RISA*"
"Robot Structural Analysis*"
"Prokon*"
"ADAPT*"
"Limcon*"
"RAM Connection*"
"RAM Elements*"
"ProtaStructure*"
"Advance Design*"
"SCIA Engineer*"
"Dlubal RFEM*"
"Dlubal RSTAB*"
"CSC Fastrak*"
"Oasys*"
"LUSAS*"
"MSC*"
"Nastran*"
"Patran*"
"Adams*"
"HyperWorks*"
"Altair*"
"FARO*"
"Leica*"
"Topcon*"
"Trimble*"
"Carlson*"
"Eagle Point*"
"InRoads*"
"GEOPAK*"
"Land Desktop*"
"Survey*"
"12d Model*"
"Microsurvey*"
"TBC*"
"Business Center*"
"Terramodel*"
"Surfer*"
"Global Mapper*"
"Quick Terrain*"
"Virtual Surveyor*"
"Pix4D*"
"Agisoft*"
"ContextCapture*"
"PhotoScan*"
"Metashape*"
"DroneDeploy*"
"Recap*"
"CloudCompare*"
"MeshLab*"
"Pointfuse*"
"ClearEdge3D*"
"FARO Scene*"
"Leica Cyclone*"
"Riegl RiSCAN*"
"Topcon ScanMaster*"
"Trimble RealWorks*"
)
}
# Function to stop related services
function Stop-EngineeringServices {
Write-Host "`nStopping engineering software services..." -ForegroundColor Cyan
$ServicesToStop = @(
"*Autodesk*"
"*Vectorworks*"
"*Bluebeam*"
"*Bentley*"
"*SolidWorks*"
"*ANSYS*"
"*FlexNet*"
"*FLEXlm*"
"*Sentinel*"
"*SafeNet*"
"*CodeMeter*"
"*WIBU*"
"*RLM*"
"*Reprise*"
"*MathWorks*"
"*ESRI*"
"*Tekla*"
"*RISA*"
"*SCIA*"
"*Dlubal*"
)
foreach ($ServicePattern in $ServicesToStop) {
try {
Get-Service | Where-Object {$_.Name -like $ServicePattern -or $_.DisplayName -like $ServicePattern} |
ForEach-Object {
Write-Host "Stopping service: $($_.DisplayName)" -ForegroundColor Yellow
Stop-Service $_.Name -Force -ErrorAction SilentlyContinue
Set-Service $_.Name -StartupType Disabled -ErrorAction SilentlyContinue
}
}
catch {
Write-Host "Could not stop service $ServicePattern" -ForegroundColor Red
}
}
}
# Function to remove software using registry-based uninstall (MUCH faster and safer than Win32_Product)
function Remove-EngineeringSoftware {
param($SoftwareCategories)
Write-Host "`nRemoving engineering software..." -ForegroundColor Cyan
Write-Host "Using registry-based removal for better performance and safety..." -ForegroundColor Yellow
foreach ($Category in $SoftwareCategories.Keys) {
Write-Host "`nProcessing $Category software..." -ForegroundColor Yellow
foreach ($SoftwareName in $SoftwareCategories[$Category]) {
try {
# Search in both 64-bit and 32-bit registry locations
$UninstallPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
)
$FoundSoftware = $false
foreach ($Path in $UninstallPaths) {
try {
$UninstallKeys = Get-ChildItem -Path $Path -ErrorAction SilentlyContinue |
Get-ItemProperty -ErrorAction SilentlyContinue |
Where-Object {$_.DisplayName -like $SoftwareName}
foreach ($Key in $UninstallKeys) {
if ($Key.UninstallString) {
$FoundSoftware = $true
Write-Host " Found: $($Key.DisplayName)" -ForegroundColor Green
try {
# Handle MSI-based uninstalls
if ($Key.UninstallString -match "msiexec") {
# Extract GUID from uninstall string
if ($Key.UninstallString -match '\{[a-fA-F0-9\-]+\}') {
$GUID = $Matches[0]
Write-Host " Uninstalling via msiexec: $GUID" -ForegroundColor Cyan
Start-Process "msiexec.exe" -ArgumentList "/X$GUID /quiet /norestart" -Wait -NoNewWindow -ErrorAction SilentlyContinue
}
}
# Handle EXE-based uninstalls
else {
$UninstallCmd = $Key.UninstallString -replace '"', ''
Write-Host " Uninstalling via executable: $UninstallCmd" -ForegroundColor Cyan
# Try common silent uninstall switches
$SilentSwitches = @("/S", "/s", "/quiet", "/SILENT", "/VERYSILENT", "-silent")
$Success = $false
foreach ($Switch in $SilentSwitches) {
try {
Start-Process $UninstallCmd -ArgumentList $Switch -Wait -NoNewWindow -ErrorAction SilentlyContinue
$Success = $true
break
}
catch {
continue
}
}
if (-not $Success) {
Write-Host " Could not silently uninstall. May require manual removal." -ForegroundColor Yellow
}
}
}
catch {
Write-Host " Error uninstalling: $($Key.DisplayName) - $($_.Exception.Message)" -ForegroundColor Yellow
}
}
}
}
catch {
# Silently continue if registry path doesn't exist or is inaccessible
continue
}
}
if (-not $FoundSoftware) {
Write-Host " No matches found for pattern: $SoftwareName" -ForegroundColor Gray
}
}
catch {
Write-Host " Error processing $SoftwareName - $($_.Exception.Message)" -ForegroundColor Yellow
}
}
}
Write-Host "`nSoftware removal process completed." -ForegroundColor Green
}
# Function to clean registry entries
function Remove-RegistryEntries {
Write-Host "`nCleaning registry entries..." -ForegroundColor Cyan
$RegistryPaths = @(
"HKLM:\SOFTWARE\Autodesk"
"HKLM:\SOFTWARE\Vectorworks"
"HKLM:\SOFTWARE\Bluebeam"
"HKLM:\SOFTWARE\Bentley"
"HKLM:\SOFTWARE\SolidWorks*"
"HKLM:\SOFTWARE\Dassault*"
"HKLM:\SOFTWARE\SketchUp"
"HKLM:\SOFTWARE\Google\SketchUp"
"HKLM:\SOFTWARE\Trimble"
"HKLM:\SOFTWARE\McNeel"
"HKLM:\SOFTWARE\ANSYS*"
"HKLM:\SOFTWARE\MathWorks"
"HKLM:\SOFTWARE\ESRI"
"HKLM:\SOFTWARE\Tekla"
"HKLM:\SOFTWARE\RISA"
"HKLM:\SOFTWARE\Computers and Structures"
"HKLM:\SOFTWARE\PTC"
"HKLM:\SOFTWARE\FlexNet*"
"HKLM:\SOFTWARE\FLEXlm*"
"HKLM:\SOFTWARE\SafeNet*"
"HKLM:\SOFTWARE\Sentinel*"
"HKLM:\SOFTWARE\CodeMeter*"
"HKLM:\SOFTWARE\WIBU*"
"HKCU:\SOFTWARE\Autodesk"
"HKCU:\SOFTWARE\Vectorworks"
"HKCU:\SOFTWARE\Bluebeam"
"HKCU:\SOFTWARE\SolidWorks*"
"HKCU:\SOFTWARE\SketchUp"
"HKCU:\SOFTWARE\McNeel"
)
foreach ($RegPath in $RegistryPaths) {
try {
if (Test-Path $RegPath) {
Write-Host "Removing registry key: $RegPath" -ForegroundColor Yellow
Remove-Item -Path $RegPath -Recurse -Force -ErrorAction SilentlyContinue
}
}
catch {
Write-Host "Could not remove registry key: $RegPath" -ForegroundColor Red
}
}
}
# Function to remove leftover folders
function Remove-LeftoverFolders {
Write-Host "`nRemoving leftover folders..." -ForegroundColor Cyan
$FoldersToRemove = @(
"C:\Program Files\Autodesk"
"C:\Program Files (x86)\Autodesk"
"C:\Program Files\Vectorworks*"
"C:\Program Files (x86)\Vectorworks*"
"C:\Program Files\Bluebeam*"
"C:\Program Files (x86)\Bluebeam*"
"C:\Program Files\Bentley"
"C:\Program Files (x86)\Bentley"
"C:\Program Files\SolidWorks*"
"C:\Program Files\SOLIDWORKS*"
"C:\Program Files\Common Files\SolidWorks*"
"C:\Program Files\SketchUp"
"C:\Program Files (x86)\SketchUp"
"C:\Program Files\Google\Google SketchUp*"
"C:\Program Files (x86)\Google\Google SketchUp*"
"C:\Program Files\McNeel"
"C:\Program Files (x86)\McNeel"
"C:\Program Files\ANSYS*"
"C:\Program Files\MathWorks"
"C:\Program Files\ArcGIS"
"C:\Program Files (x86)\ArcGIS"
"C:\Program Files\Tekla*"
"C:\Program Files\RISA*"
"C:\Program Files\Computers and Structures"
"C:\Program Files (x86)\Computers and Structures"
"C:\Program Files\PTC"
"C:\Program Files (x86)\PTC"
"C:\ProgramData\Autodesk"
"C:\ProgramData\Vectorworks"
"C:\ProgramData\Bluebeam"
"C:\ProgramData\Bentley"
"C:\ProgramData\SolidWorks"
"C:\ProgramData\SOLIDWORKS"
"C:\ProgramData\SketchUp"
"C:\ProgramData\McNeel"
"C:\ProgramData\ANSYS"
"C:\ProgramData\MathWorks"
"C:\ProgramData\ESRI"
"C:\ProgramData\Tekla"
"C:\ProgramData\FlexNet*"
"C:\ProgramData\FLEXlm*"
"C:\ProgramData\SafeNet*"
"C:\ProgramData\Sentinel*"
"C:\ProgramData\CodeMeter*"
"C:\Users\$env:USERNAME\AppData\Roaming\Autodesk"
"C:\Users\$env:USERNAME\AppData\Local\Autodesk"
"C:\Users\$env:USERNAME\AppData\Roaming\Vectorworks"
"C:\Users\$env:USERNAME\AppData\Roaming\Bluebeam*"
"C:\Users\$env:USERNAME\AppData\Roaming\SolidWorks"
"C:\Users\$env:USERNAME\AppData\Roaming\SOLIDWORKS"
"C:\Users\$env:USERNAME\AppData\Local\SolidWorks"
"C:\Users\$env:USERNAME\AppData\Roaming\SketchUp"
"C:\Users\$env:USERNAME\AppData\Roaming\McNeel"
"C:\Users\$env:USERNAME\AppData\Local\McNeel"
"C:\Users\$env:USERNAME\Documents\Autodesk"
"C:\Users\$env:USERNAME\Documents\SolidWorks*"
"C:\Users\$env:USERNAME\Documents\My Games\*CAD*"
)
foreach ($Folder in $FoldersToRemove) {
try {
$ExpandedPaths = Get-ChildItem -Path (Split-Path $Folder -Parent) -Directory -Filter (Split-Path $Folder -Leaf) -ErrorAction SilentlyContinue
foreach ($Path in $ExpandedPaths) {
if (Test-Path $Path.FullName) {
Write-Host "Removing folder: $($Path.FullName)" -ForegroundColor Yellow
Remove-Item -Path $Path.FullName -Recurse -Force -ErrorAction SilentlyContinue
}
}
# Direct path removal
if (Test-Path $Folder) {
Write-Host "Removing folder: $Folder" -ForegroundColor Yellow
Remove-Item -Path $Folder -Recurse -Force -ErrorAction SilentlyContinue
}
}
catch {
Write-Host "Could not remove folder: $Folder" -ForegroundColor Red
}
}
}
# Function to clean temporary files
function Remove-TempFiles {
Write-Host "`nCleaning temporary files..." -ForegroundColor Cyan
$TempPaths = @(
"$env:TEMP\Autodesk*"
"$env:TEMP\Vectorworks*"
"$env:TEMP\Bluebeam*"
"$env:TEMP\SolidWorks*"
"$env:TEMP\SOLIDWORKS*"
"$env:TEMP\McNeel*"
"$env:TEMP\ANSYS*"
"$env:TEMP\MathWorks*"
"C:\Windows\Temp\Autodesk*"
"C:\Windows\Temp\Vectorworks*"
"C:\Windows\Temp\Bluebeam*"
"C:\Windows\Temp\SolidWorks*"
)
foreach ($TempPath in $TempPaths) {
try {
if (Test-Path $TempPath) {
Write-Host "Cleaning temp files: $TempPath" -ForegroundColor Yellow
Remove-Item -Path $TempPath -Recurse -Force -ErrorAction SilentlyContinue
}
}
catch {
Write-Host "Could not clean temp files: $TempPath" -ForegroundColor Red
}
}
}
# Non-interactive path
if ($NonInteractive) {
switch ($Mode) {
"All" {
if ($ConfirmRemoval) {
Stop-EngineeringServices
Remove-EngineeringSoftware $EngineeringSoftware
Remove-RegistryEntries
Remove-LeftoverFolders
Remove-TempFiles
}
else {
Write-Warning "Non-interactive mode: use -ConfirmRemoval to proceed with ALL removals."
}
}
"Autodesk" {
$AutodeskOnly = @{"Autodesk" = $EngineeringSoftware["Autodesk"]}
Stop-EngineeringServices
Remove-EngineeringSoftware $AutodeskOnly
Remove-RegistryEntries
Remove-LeftoverFolders
Remove-TempFiles
}
"Vectorworks" {
$VectorworksOnly = @{"Vectorworks" = $EngineeringSoftware["Vectorworks"]}
Remove-EngineeringSoftware $VectorworksOnly
}
"Bluebeam" {
$BluebeamOnly = @{"Bluebeam" = $EngineeringSoftware["Bluebeam"]}
Remove-EngineeringSoftware $BluebeamOnly
}
"SolidWorks" {
$SolidWorksOnly = @{"SolidWorks" = $EngineeringSoftware["SolidWorks"]}
Remove-EngineeringSoftware $SolidWorksOnly
}
"Bentley" {
$BentleyOnly = @{"BentleyMicrostation" = $EngineeringSoftware["BentleyMicrostation"]}
Remove-EngineeringSoftware $BentleyOnly
}
"List" {
Write-Host "`nScanning for installed engineering software..." -ForegroundColor Cyan
Write-Host "This may take a moment..." -ForegroundColor Yellow
$EngineeringPatterns = @(
"*AutoCAD*", "*Autodesk*", "*Vectorworks*", "*Bluebeam*",
"*SolidWorks*", "*Civil 3D*", "*Bentley*", "*MicroStation*",
"*ANSYS*", "*MATLAB*", "*ArcGIS*", "*SketchUp*", "*Rhino*",
"*Tekla*", "*ETABS*", "*SAP2000*", "*RISA*", "*Revit*"
)
$InstalledSoftware = @()
$UninstallPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
)
foreach ($Path in $UninstallPaths) {
try {
$Apps = Get-ChildItem -Path $Path -ErrorAction SilentlyContinue |
Get-ItemProperty -ErrorAction SilentlyContinue |
Where-Object {
$DisplayName = $_.DisplayName
$DisplayName -and ($EngineeringPatterns | Where-Object {$DisplayName -like $_})
} |
Select-Object DisplayName, DisplayVersion, Publisher |
Where-Object {$_.DisplayName}
$InstalledSoftware += $Apps
}
catch {
continue
}
}
$InstalledSoftware = $InstalledSoftware | Sort-Object DisplayName -Unique
if ($InstalledSoftware.Count -gt 0) {
Write-Host "`nFound $($InstalledSoftware.Count) engineering software package(s):`n" -ForegroundColor Green
$InstalledSoftware | Format-Table -Property DisplayName, DisplayVersion, Publisher -AutoSize
}
else {
Write-Host "`nNo engineering software found." -ForegroundColor Green
}
}
"Cleanup" {
Remove-RegistryEntries
Remove-LeftoverFolders
Remove-TempFiles
}
default { }
}
Write-Host "`nEngineering software removal completed!" -ForegroundColor Green
Write-Host "It's recommended to restart your computer to complete the cleanup." -ForegroundColor Yellow
exit 0
}
# Main execution menu
do {
Write-Host "`n=== ENGINEERING SOFTWARE REMOVAL MENU ===" -ForegroundColor Green
Write-Host "1. Complete removal (ALL engineering software)"
Write-Host "2. Remove Autodesk products only"
Write-Host "3. Remove Vectorworks only"
Write-Host "4. Remove Bluebeam only"
Write-Host "5. Remove SolidWorks only"
Write-Host "6. Remove Bentley products only"
Write-Host "7. List installed engineering software"
Write-Host "8. Clean registry and leftover files only"
Write-Host "9. Exit"
$choice = Read-Host "`nSelect an option (1-9)"
switch ($choice) {
"1" {
Write-Host "`nThis will completely remove ALL engineering software!" -ForegroundColor Red
Write-Host "This includes ALL versions of AutoCAD, Civil 3D, Vectorworks, Bluebeam, SolidWorks, etc." -ForegroundColor Yellow
$confirmation = Read-Host "`nAre you absolutely sure? This cannot be undone! (yes/no)"
if ($confirmation -eq "yes") {
Stop-EngineeringServices
Remove-EngineeringSoftware $EngineeringSoftware
Remove-RegistryEntries
Remove-LeftoverFolders
Remove-TempFiles
Write-Host "`nComplete removal finished! Restart your computer to finalize." -ForegroundColor Green
}
}
"2" {
$AutodeskOnly = @{"Autodesk" = $EngineeringSoftware["Autodesk"]}
Stop-EngineeringServices
Remove-EngineeringSoftware $AutodeskOnly
Remove-RegistryEntries
Remove-LeftoverFolders
Remove-TempFiles
}
"3" {
$VectorworksOnly = @{"Vectorworks" = $EngineeringSoftware["Vectorworks"]}
Remove-EngineeringSoftware $VectorworksOnly
}
"4" {
$BluebeamOnly = @{"Bluebeam" = $EngineeringSoftware["Bluebeam"]}
Remove-EngineeringSoftware $BluebeamOnly
}
"5" {
$SolidWorksOnly = @{"SolidWorks" = $EngineeringSoftware["SolidWorks"]}
Remove-EngineeringSoftware $SolidWorksOnly
}
"6" {
$BentleyOnly = @{"BentleyMicrostation" = $EngineeringSoftware["BentleyMicrostation"]}
Remove-EngineeringSoftware $BentleyOnly
}
"7" {
Write-Host "`nScanning for installed engineering software..." -ForegroundColor Cyan
Write-Host "This may take a moment..." -ForegroundColor Yellow
$EngineeringPatterns = @(
"*AutoCAD*", "*Autodesk*", "*Vectorworks*", "*Bluebeam*",
"*SolidWorks*", "*Civil 3D*", "*Bentley*", "*MicroStation*",
"*ANSYS*", "*MATLAB*", "*ArcGIS*", "*SketchUp*", "*Rhino*",
"*Tekla*", "*ETABS*", "*SAP2000*", "*RISA*", "*Revit*"
)
$InstalledSoftware = @()
# Search in both 64-bit and 32-bit registry locations
$UninstallPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
)
foreach ($Path in $UninstallPaths) {
try {
$Apps = Get-ChildItem -Path $Path -ErrorAction SilentlyContinue |
Get-ItemProperty -ErrorAction SilentlyContinue |
Where-Object {
$DisplayName = $_.DisplayName
$DisplayName -and ($EngineeringPatterns | Where-Object {$DisplayName -like $_})
} |
Select-Object DisplayName, DisplayVersion, Publisher |
Where-Object {$_.DisplayName} # Remove entries without DisplayName
$InstalledSoftware += $Apps
}
catch {
# Silently continue if registry path doesn't exist
continue
}
}
# Remove duplicates and sort
$InstalledSoftware = $InstalledSoftware | Sort-Object DisplayName -Unique
if ($InstalledSoftware.Count -gt 0) {
Write-Host "`nFound $($InstalledSoftware.Count) engineering software package(s):`n" -ForegroundColor Green
$InstalledSoftware | Format-Table -Property DisplayName, DisplayVersion, Publisher -AutoSize
}
else {
Write-Host "`nNo engineering software found." -ForegroundColor Green
}
}
"8" {
Write-Host "`nCleaning registry and leftover files only..." -ForegroundColor Cyan
Remove-RegistryEntries
Remove-LeftoverFolders
Remove-TempFiles
}
"9" { break }
default { Write-Host "Invalid option" -ForegroundColor Red }
}
} while ($choice -ne "9")
Write-Host "`nEngineering software removal completed!" -ForegroundColor Green
Write-Host "It's recommended to restart your computer to complete the cleanup." -ForegroundColor Yellow