-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.bat
131 lines (117 loc) · 4.37 KB
/
app.bat
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
@echo off
title UTweaker
color 0A
set "powershell_path=%SystemDrive%\Program Files\PowerShell\7\pwsh.exe"
powershell -Command "If (-Not([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {Start-Process '%powershell_path%' '-ExecutionPolicy Bypass -NoProfile -File \"%~f0\"' -Verb RunAs; exit}"
:menu
cls
echo ========================================
echo Welcome to UTweaker
echo ========================================
echo WARNING: FedotovDev takes no responsibility
echo for any damage to your PC or OS.
echo Use at your own risk.
echo ========================================
echo Choose an action:
echo 1. Speed up application shutdown
echo 2. Disable system restore
echo 3. Change pagefile size
echo 4. Show hidden files and folders
echo 5. Run PowerShell script for system info (Admin)
echo 6. Show File Tree of HDD (Admin)
echo 7. Clear All Cache
echo 8. Rename Operating System
echo 9. Optimize network settings for speed
echo 10. Exit
echo ========================================
set /p choice=Enter the number of your choice:
if %choice%==1 goto speedup_apps
if %choice%==2 goto disable_restore
if %choice%==3 goto change_pagefile
if %choice%==4 goto show_hidden
if %choice%==5 goto run_powershell_admin
if %choice%==6 goto show_file_tree
if %choice%==7 goto clear_cache
if %choice%==8 goto rename_os
if %choice%==9 goto optimize_network
if %choice%==10 goto exit
goto error
:speedup_apps
cls
echo Speeding up application shutdown...
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WaitToKillAppTimeout /t REG_SZ /d 1000 /f >nul 2>&1 || goto error
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control" /v WaitToKillServiceTimeout /t REG_SZ /d 1000 /f >nul 2>&1 || goto error
echo Applications will shut down faster.
pause
goto menu
:disable_restore
cls
echo Disabling system restore...
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\SystemRestore" /v DisableSR /t REG_DWORD /d 1 /f >nul 2>&1 || goto error
echo System restore has been disabled.
pause
goto menu
:change_pagefile
cls
echo Changing pagefile size...
set /p size=Enter the new pagefile size in megabytes:
wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False >nul 2>&1 || goto error
wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=%size%,MaximumSize=%size% >nul 2>&1 || goto error
echo Pagefile size changed to %size% MB.
pause
goto menu
:show_hidden
cls
echo Showing hidden files and folders...
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 1 /f >nul 2>&1 || goto error
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSuperHidden /t REG_DWORD /d 1 /f >nul 2>&1 || goto error
echo Hidden files and folders are now visible.
pause
goto menu
:run_powershell_admin
cls
echo Running PowerShell script for system information with admin rights...
start "" "%SystemDrive%\Program Files\PowerShell\7\pwsh.exe" -ExecutionPolicy Bypass -NoProfile -File powersh\sysinfo.ps1 || goto error
pause
goto menu
:show_file_tree
cls
echo Showing file tree of the hard drive...
start "" "%SystemDrive%\Program Files\PowerShell\7\pwsh.exe" -NoProfile -Command "Get-ChildItem C:\ -Recurse | Format-Wide -Property FullName" || goto error
pause
goto menu
:clear_cache
cls
echo Clearing all unnecessary cache...
rd /s /q "%temp%" >nul 2>&1 || goto error
del /s /q "%SystemRoot%\Temp\*" >nul 2>&1 || goto error
echo Cache has been cleared successfully.
pause
goto menu
:rename_os
cls
echo Renaming the operating system...
set /p new_os_name=Enter the new OS name:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName /t REG_SZ /d "%new_os_name%" /f >nul 2>&1 || goto error
echo OS name changed to %new_os_name%.
pause
goto menu
:optimize_network
cls
echo Optimizing network settings for better speed...
netsh interface tcp set global autotuninglevel=normal >nul 2>&1 || goto error
netsh interface tcp set global rss=enabled >nul 2>&1 || goto error
echo Network settings have been optimized.
pause
goto menu
:error
cls
echo An error occurred
start "" "popups/error.vbs"
pause
goto menu
:exit
cls
echo Thank you for using UTweaker!
pause
exit