Skip to content

Commit b66d04e

Browse files
authored
Merge pull request #3 from EndCod3r/dev
Version 0.1.1
2 parents 1cccdbf + c7cf9a1 commit b66d04e

2 files changed

Lines changed: 60 additions & 36 deletions

File tree

Config/services.json

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@
8686
"OriginalType": "Manual"
8787
},
8888
{
89-
"Name": "BcastDVRUserService_dc2a4",
89+
"Name": "BcastDVRUserService_*",
9090
"StartupType": "Manual",
9191
"OriginalType": "Manual"
9292
},
9393
{
94-
"Name": "BluetoothUserService_dc2a4",
94+
"Name": "BluetoothUserService_*",
9595
"StartupType": "Manual",
9696
"OriginalType": "Manual"
9797
},
@@ -121,7 +121,7 @@
121121
"OriginalType": "Automatic"
122122
},
123123
{
124-
"Name": "CDPUserSvc_dc2a4",
124+
"Name": "CDPUserSvc_*",
125125
"StartupType": "Automatic",
126126
"OriginalType": "Automatic"
127127
},
@@ -131,7 +131,7 @@
131131
"OriginalType": "Manual"
132132
},
133133
{
134-
"Name": "CaptureService_dc2a4",
134+
"Name": "CaptureService_*",
135135
"StartupType": "Manual",
136136
"OriginalType": "Manual"
137137
},
@@ -146,7 +146,7 @@
146146
"OriginalType": "Manual"
147147
},
148148
{
149-
"Name": "ConsentUxUserSvc_dc2a4",
149+
"Name": "ConsentUxUserSvc_*",
150150
"StartupType": "Manual",
151151
"OriginalType": "Manual"
152152
},
@@ -156,7 +156,7 @@
156156
"OriginalType": "Automatic"
157157
},
158158
{
159-
"Name": "CredentialEnrollmentManagerUserSvc_dc2a4",
159+
"Name": "CredentialEnrollmentManagerUserSvc_*",
160160
"StartupType": "Manual",
161161
"OriginalType": "Manual"
162162
},
@@ -191,7 +191,7 @@
191191
"OriginalType": "Manual"
192192
},
193193
{
194-
"Name": "DeviceAssociationBrokerSvc_dc2a4",
194+
"Name": "DeviceAssociationBrokerSvc_*",
195195
"StartupType": "Manual",
196196
"OriginalType": "Manual"
197197
},
@@ -206,12 +206,12 @@
206206
"OriginalType": "Manual"
207207
},
208208
{
209-
"Name": "DevicePickerUserSvc_dc2a4",
209+
"Name": "DevicePickerUserSvc_*",
210210
"StartupType": "Manual",
211211
"OriginalType": "Manual"
212212
},
213213
{
214-
"Name": "DevicesFlowUserSvc_dc2a4",
214+
"Name": "DevicesFlowUserSvc_*",
215215
"StartupType": "Manual",
216216
"OriginalType": "Manual"
217217
},
@@ -421,7 +421,7 @@
421421
"OriginalType": "Manual"
422422
},
423423
{
424-
"Name": "MessagingService_dc2a4",
424+
"Name": "MessagingService_*",
425425
"StartupType": "Manual",
426426
"OriginalType": "Manual"
427427
},
@@ -446,7 +446,7 @@
446446
"OriginalType": "Disabled"
447447
},
448448
{
449-
"Name": "NPSMSvc_dc2a4",
449+
"Name": "NPSMSvc_*",
450450
"StartupType": "Manual",
451451
"OriginalType": "Manual"
452452
},
@@ -482,8 +482,8 @@
482482
},
483483
{
484484
"Name": "Netlogon",
485-
"StartupType": "Manual",
486-
"OriginalType": "Manual"
485+
"StartupType": "Automatic",
486+
"OriginalType": "Automatic"
487487
},
488488
{
489489
"Name": "Netman",
@@ -506,12 +506,12 @@
506506
"OriginalType": "Manual"
507507
},
508508
{
509-
"Name": "OneSyncSvc_dc2a4",
509+
"Name": "OneSyncSvc_*",
510510
"StartupType": "Automatic",
511511
"OriginalType": "Automatic"
512512
},
513513
{
514-
"Name": "P9RdrService_dc2a4",
514+
"Name": "P9RdrService_*",
515515
"StartupType": "Manual",
516516
"OriginalType": "Manual"
517517
},
@@ -536,7 +536,7 @@
536536
"OriginalType": "Manual"
537537
},
538538
{
539-
"Name": "PenService_dc2a4",
539+
"Name": "PenService_*",
540540
"StartupType": "Manual",
541541
"OriginalType": "Manual"
542542
},
@@ -551,7 +551,7 @@
551551
"OriginalType": "Manual"
552552
},
553553
{
554-
"Name": "PimIndexMaintenanceSvc_dc2a4",
554+
"Name": "PimIndexMaintenanceSvc_*",
555555
"StartupType": "Manual",
556556
"OriginalType": "Manual"
557557
},
@@ -576,7 +576,7 @@
576576
"OriginalType": "Manual"
577577
},
578578
{
579-
"Name": "PrintWorkflowUserSvc_dc2a4",
579+
"Name": "PrintWorkflowUserSvc_*",
580580
"StartupType": "Manual",
581581
"OriginalType": "Manual"
582582
},
@@ -851,7 +851,7 @@
851851
"OriginalType": "Manual"
852852
},
853853
{
854-
"Name": "UdkUserSvc_dc2a4",
854+
"Name": "UdkUserSvc_*",
855855
"StartupType": "Manual",
856856
"OriginalType": "Manual"
857857
},
@@ -866,12 +866,12 @@
866866
"OriginalType": "Manual"
867867
},
868868
{
869-
"Name": "UnistoreSvc_dc2a4",
869+
"Name": "UnistoreSvc_*",
870870
"StartupType": "Manual",
871871
"OriginalType": "Manual"
872872
},
873873
{
874-
"Name": "UserDataSvc_dc2a4",
874+
"Name": "UserDataSvc_*",
875875
"StartupType": "Manual",
876876
"OriginalType": "Manual"
877877
},
@@ -1051,15 +1051,10 @@
10511051
"OriginalType": "Automatic"
10521052
},
10531053
{
1054-
"Name": "WpnUserService_dc2a4",
1054+
"Name": "WpnUserService_*",
10551055
"StartupType": "Automatic",
10561056
"OriginalType": "Automatic"
10571057
},
1058-
{
1059-
"Name": "WwanSvc",
1060-
"StartupType": "Manual",
1061-
"OriginalType": "Manual"
1062-
},
10631058
{
10641059
"Name": "XblAuthManager",
10651060
"StartupType": "Manual",
@@ -1096,7 +1091,7 @@
10961091
"OriginalType": "Manual"
10971092
},
10981093
{
1099-
"Name": "cbdhsvc_dc2a4",
1094+
"Name": "cbdhsvc_*",
11001095
"StartupType": "Manual",
11011096
"OriginalType": "Automatic"
11021097
},
@@ -1366,7 +1361,7 @@
13661361
"OriginalType": "Manual"
13671362
},
13681363
{
1369-
"Name": "webthreatdefusersvc_dc2a4",
1364+
"Name": "webthreatdefusersvc_*",
13701365
"StartupType": "Automatic",
13711366
"OriginalType": "Automatic"
13721367
},

optimize.ps1

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
.NOTES
99
Author : EndLordHD @EndCod3r
1010
GitHub : https://github.com/EndCod3r
11-
Version : Pre-release v0.1
11+
Version : Pre-release v0.2
1212
#>
1313

1414
# Checking for admin privileges
@@ -19,15 +19,15 @@ if (-Not $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Adm
1919
}
2020

2121
# Create restore point
22-
$userinput = Read-Host -Prompt 'Do you want to have a restore point created? (Y/n)'
22+
$userinput = Read-Host -Prompt 'Do you want to have a restore point created? (Recommended) (Y/n)'
2323
$userinput = $userinput.ToLower()
2424
if ( $userinput -eq 'y' -or !$userinput ) {
2525
Checkpoint-Computer -Description "Pre-Optimizations" -RestorePointType "MODIFY_SETTINGS"
2626
Write-Output "If anything happens that you don't want then you can go back to this restore point."
2727
}
2828

2929
# Checks if Ultimate Performance plan exists and if it doesn't it adds it
30-
$userinput = Read-Host -Prompt 'Do you want to add Ultimate Performance power plan? (Y/n)'
30+
$userinput = Read-Host -Prompt 'Do you want to add Ultimate Performance power plan? (Recommended) (Y/n)'
3131
if ( $userinput -eq 'y' -or !$userinput ) {
3232
# From ChrisTitusTech/winutil
3333
$powerSchemeName = "Ultimate Performance"
@@ -44,21 +44,50 @@ if ( $userinput -eq 'y' -or !$userinput ) {
4444
powercfg -attributes SUB_SLEEP 7bc4a2f9-d8fc-4469-b07b-33eb785aaca0 -ATTRIB_HIDE
4545
powercfg -setactive $powerSchemeGuid
4646
powercfg -change -monitor-timeout-ac 0
47-
47+
48+
Write-Output "Make sure that the Ultimate Performance power plan is active."
49+
50+
$i = 3
51+
do {
52+
Write-Host "Opeing Power Options in $i seconds."
53+
Start-Sleep 1
54+
$i--
55+
} while ($i -gt 0)
56+
57+
control.exe /name Microsoft.PowerOptions
58+
4859
} else {
4960
Write-Host "Power scheme '$powerSchemeName' already exists."
5061
}
5162
}
5263

5364
# Set some services to manual
54-
$userinput = Read-Host -Prompt 'Do you want to optimize services? (Y/n)'
65+
$userinput = Read-Host -Prompt 'Do you want to optimize services? (Recommended) (Y/n)'
5566
if ( $userinput -eq 'y' -or !$userinput ) {
5667

5768
$Services = Get-Content .\Config\services.json | ConvertFrom-Json
5869

5970
for ($i = 0; $i -lt $Services.service.name.Count; $i++) {
60-
$Services.service.name[$i] | Set-Service -StartupType $Services.service.StartupType[$i] | Out-Null
71+
$Services.service.name[$i] | Set-Service -StartupType $Services.service.StartupType[$i] -ErrorAction SilentlyContinue
6172
}
6273

63-
Write-Output "If you see any errors stating that the service doesn't exist don't worry nothing is wrong."
74+
Write-Output "
75+
If you see any errors stating ""Service wasn't found"" or ""Access is denied,"" don't worry, nothing is wrong.
76+
"
77+
}
78+
79+
# Delete C:\Windows\Temp and user's temporary files
80+
$userinput = Read-Host -Prompt 'Do you want to delete temporary files (Recommended) (Y/n)'
81+
if ( $userinput -eq 'y' -or !$userinput ) {
82+
Write-Output "Removing Windows Temporary Files (C:\Windows\Temp)"
83+
Start-Sleep 1
84+
Get-ChildItem -Path "C:\Windows\Temp" *.* -Recurse | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue
85+
86+
Write-Output "Removing User Temporary Files ($env:TEMP)"
87+
Start-Sleep 1
88+
Get-ChildItem -Path $env:TEMP *.* -Recurse | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue
89+
90+
Write-Output "
91+
If you see any errors stating ""Access is denied,"" don't worry, nothing is wrong.
92+
"
6493
}

0 commit comments

Comments
 (0)