-
Notifications
You must be signed in to change notification settings - Fork 0
/
Win7优化.bat
546 lines (511 loc) · 20.6 KB
/
Win7优化.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
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
@Echo Off
Title win7优化
::by 卡饭 我呀擦擦
set TempFile_Name=%SystemRoot%\System32\BatTestUACin_SysRt%Random%.batemp
( echo "BAT Test UAC in Temp" >%TempFile_Name% ) 1>nul 2>nul
if exist %TempFile_Name% (
del %TempFile_Name% 1>nul 2>nul
GOTO menu
) else (
GOTO admin
)
:menu
ECHO =============================================================================
ECHO Windows 7 优化
ECHO #+++++++++++++++++++++++++++++++++++++++#+++++++++++++++++++++++++++++++++++#
ECHO # 0、备份/还原注册表 #
ECHO # #
ECHO # 1、去除快捷方式小箭头 # 2、去除快捷方式字样 #
ECHO # 3、开机磁盘扫描等待时间 # 4、win7离开模式 #
ECHO # 5、去除休眠文件 # 6、退出程序时自动清理内存中的DLL #
ECHO # 7、关闭程序兼容性助手 # 8、关闭UAC #
ECHO # 9、关闭DEP # 10、停止系统还原与备份 #
ECHO # 11、关闭盖子不采取任何操作(笔记本专用)# 12、迁移用户文档桌面 #
ECHO # 13、去除操作中心 # 14、设置虚拟内存 #
ECHO # 15、任务栏显示星期几 # 16、关闭自动播放 #
ECHO # 17、右键菜单添加管理员取得所有权 # 18、右键菜单添加用记事本打开 #
ECHO # 19、右键菜单添加显示后缀隐藏文件 # 20、加快菜单与任务栏预览的显示速度#
ECHO # 21、清除右键显卡菜单项 # 22、清除右键新建项目 #
ECHO # 23、清除任务栏历史图标 # 24、清除右键菜单还原以前的版本 #
ECHO # 25、清除右键菜单兼容性疑难解答 # 26、清空图标缓存 #
ECHO # 27、禁用虚拟内存 # 28、关机时强制退出应用程序 #
ECHO # 29、清除右键桌面小工具 # 30、将U盘转化为ntfs #
ECHO #+++++++++++++++++++++++++++++++++++++++#+++++++++++++++++++++++++++++++++++#
ECHO =============================================================================
set /p a= 请输入操作序号并回车:
if %a%==0 goto 备份/还原注册表
if %a%==1 goto 去除快捷方式小箭头
if %a%==2 goto 去除快捷方式字样
if %a%==3 goto 开机磁盘扫描等待时间
if %a%==4 goto win7离开模式
if %a%==5 goto 去除休眠文件
if %a%==6 goto 退出程序时自动清理内存中的DLL
if %a%==7 goto 关闭程序兼容性助手
if %a%==8 goto 关闭UAC
if %a%==9 goto 关闭DEP
if %a%==10 goto 停止系统还原与备份
if %a%==11 goto 关闭盖子不采取任何操作(笔记本专用)
if %a%==12 goto 迁移用户文档桌面
if %a%==13 goto 去除操作中心
if %a%==14 goto 设置虚拟内存
if %a%==15 goto 任务栏显示星期几
if %a%==16 goto 关闭自动播放
if %a%==17 goto 右键菜单添加管理员取得所有权
if %a%==18 goto 右键菜单添加用记事本打开
if %a%==19 goto 右键菜单添加显示后缀隐藏文件
if %a%==20 goto 加快菜单与任务栏预览的显示速度
if %a%==21 goto 清除右键显卡菜单项
if %a%==22 goto 清除右键新建项目
if %a%==23 goto 清除任务栏历史图标
if %a%==24 goto 清除右键菜单还原以前的版本
if %a%==25 goto 清除右键菜单兼容性疑难解答
if %a%==26 goto 清空图标缓存
if %a%==27 goto 禁用虚拟内存
if %a%==28 goto 关机时强制退出应用程序
if %a%==29 goto 清除右键桌面小工具
if %a%==30 goto 将U盘转化为ntfs
:备份/还原注册表
ECHO.
ECHO.
ECHO **********************************
ECHO.
ECHO 备份/还原注册表
ECHO (能还原大部分修改,备份路径在D盘)
ECHO.
ECHO 1.备份
ECHO.
ECHO 2.还原
ECHO.
ECHO **********************************
ECHO.
ECHO.
Choice /C 12 /N /M 选择(1、2):
If ErrorLevel 1 If Not ErrorLevel 2 Goto 备份注册表
If ErrorLevel 2 If Not ErrorLevel 3 Goto 还原注册表
:备份注册表
regedit /E d:/注册表备份.reg
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:还原注册表
regedit /s d:/注册表备份.reg
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:去除快捷方式小箭头
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" /v 29 /d "%systemroot%\system32\imageres.dll,196" /t reg_sz /f
taskkill /f /im explorer.exe
start %SystemRoot%\explorer.exe
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:admin
CLS
ECHO 操作失败。
echo 请右键“以管理员身份运行”
ECHO 按任意键退出...
PAUSE >nul
exit
:去除快捷方式字样
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v link /t REG_BINARY /d 00000000 /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:去除休眠文件
powercfg -h off
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:win7离开模式
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v AwayModeEnabled /t REG_DWORD /d 00000001 /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:右键菜单添加显示后缀隐藏文件
ECHO.
ECHO.
ECHO **********************************
ECHO.
ECHO 右键菜单添加显示后缀隐藏文件
ECHO.
ECHO 1.添加
ECHO.
ECHO 2.删除
ECHO.
ECHO **********************************
ECHO.
ECHO.
Choice /C 12 /N /M 选择(1、2):
If ErrorLevel 1 If Not ErrorLevel 2 Goto 右键菜单添加显示后缀隐藏文件
If ErrorLevel 2 If Not ErrorLevel 3 Goto 右键菜单删除显示后缀隐藏文件
:右键菜单删除显示后缀隐藏文件
reg delete "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}" /f >nul 2>nul
del /f /q "%windir%\SuperHidden.vbs" >nul 2>nul
echo.&echo 已删除显示/隐藏扩展名及文件
pause>nul
cls
GOTO menu
:右键菜单添加显示后缀隐藏文件
>"%windir%\SuperHidden.vbs" echo Dim WSHShell
>>"%windir%\SuperHidden.vbs" echo Set WSHShell = WScript.CreateObject("WScript.Shell")
>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\CLSID", "{13709620-C279-11CE-A49E-444553540000}", "REG_SZ"
>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\method", "ShellExecute", "REG_SZ"
>>"%windir%\SuperHidden.vbs" echo if WSHShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt") = 0 then
>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "0", "REG_DWORD"
>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "2", "REG_DWORD"
>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "1", "REG_DWORD"
>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\command", "显示扩展名及文件", "REG_SZ"
>>"%windir%\SuperHidden.vbs" echo WSHShell.SendKeys "{F5}e"
>>"%windir%\SuperHidden.vbs" echo else
>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "1", "REG_DWORD"
>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "1", "REG_DWORD"
>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0", "REG_DWORD"
>>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\command", "隐藏扩展名及文件", "REG_SZ"
>>"%windir%\SuperHidden.vbs" echo WSHShell.SendKeys "{F5}e"
>>"%windir%\SuperHidden.vbs" echo end if
>>"%windir%\SuperHidden.vbs" echo Set WSHShell = Nothing
>>"%windir%\SuperHidden.vbs" echo WScript.Quit(0)
reg export "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "%temp%\__.reg" >nul
for /f "tokens=2 delims==" %%. in ('find/i "HideFileExt" "%temp%\__.reg"') do set v=%%~.
del "%temp%\__.reg"
set v=%v:~-1%
if %v% equ 0 set vv=隐藏扩展名及文件
if %v% equ 1 set vv=显示扩展名及文件
>"%temp%\_.reg" echo REGEDIT4
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\SuperHidden]
>>"%temp%\_.reg" echo @="{00000000-0000-0000-0000-000000000012}"
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\InProcServer32]
>>"%temp%\_.reg" echo @=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,32,5c,73,\
>>"%temp%\_.reg" echo 68,64,6f,63,76,77,2e,64,6c,6c,00
>>"%temp%\_.reg" echo "ThreadingModel"="Apartment"
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\Instance]
>>"%temp%\_.reg" echo "CLSID"="{3f454f0e-42ae-4d7c-8ea3-328250d6e272}"
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag]
>>"%temp%\_.reg" echo "method"="ShellExecute"
>>"%temp%\_.reg" echo "Param1"="SuperHidden.vbs"
>>"%temp%\_.reg" echo "CLSID"="{13709620-C279-11CE-A49E-444553540000}"
>>"%temp%\_.reg" echo "command"="%vv%"
regedit /s "%temp%\_.reg"
del /f /q "%temp%\_.reg"
echo.&echo 已添加右键 %vv%
pause>nul
cls
GOTO menu
:退出程序时自动清理内存中的DLL
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v AlwaysUnloadDll /t REG_DWORD /d 00000001 /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:关闭程序兼容性助手
sc stop PcsSvc
sc config PcsSvc start= disabled
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:关闭UAC
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 00000000 /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:清除右键新建项目
reg delete "HKCR\.bmp\ShellNew" /f
reg delete "HKCR\.rar\ShellNew" /f
reg delete "HKCR\.zip\ShellNew" /f
reg delete "HKCR\Briefcase\ShellNew" /f
reg delete "HKCR\.xdp\AcroExch.XDPDoc\ShellNew" /f
reg delete "HKCR\.jnt\jntfile\ShellNew" /f
reg delete "HKCR\.contact\ShellNew" /f
reg delete "HKCR\.rtf\ShellNew" /f
reg delete "HKCR\.zip\CompressedFolder\ShellNew" /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:停止系统还原与备份
net stop SDRSVC
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:清除右键显卡菜单项
regsvr32 /u igfxpph.dll /s
regsvr32 /u atiacmxx.dll /s
regsvr32 /u nvcpl.dll /s
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:清除右键桌面小工具
reg delete "HKEY_CLASSES_ROOT\DesktopBackground\Shell\Gadgets" /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:迁移用户文档桌面
set /p weizhi=请输入迁移目标分区盘符(如D:\administrator):
echo.
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Personal /t REG_EXPAND_SZ /d "%weizhi%" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop /t REG_EXPAND_SZ /d "%weizhi%\Desktop" /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:去除操作中心
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "HideSCAHealth" /d 1 /t REG_DWORD /f
gpupdate /force
taskkill /f /im explorer.exe
start %systemroot%\explorer
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:设置虚拟内存
set /p disk=请输入虚拟内存转移到的目标分区盘符(如d):
echo.
echo 自动管理虚拟内存初始大小和最大值请输入0
echo.
echo 按任意键指定虚拟内存大小
pause>nul
set /p min=请输入虚拟内存初始大小(M,如1024):
set /p max=请输入虚拟内存最大值(M,如4096):
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Memory Management" /v "PagingFiles" /d "%disk%:\pagefile.sys %min% %max%" /t REG_MULTI_SZ /f
ECHO “重启电脑生效”,按任意键返回主菜单
pause>nul
cls
GOTO menu
:任务栏显示星期几
reg add "HKCU\Control Panel\International" /v "sLongDate" /d "yyyy'年'M'月'd'日', dddd" /t REG_SZ /f
reg add "HKCU\Control Panel\International" /v "sShortDate" /d "yyyy/M/d/ddd" /t REG_SZ /f
taskkill /f /im explorer.exe
start %systemroot%\explorer
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:关闭自动播放
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /d 255 /t REG_DWORD /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /d 255 /t REG_DWORD /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:关闭盖子不采取任何操作
powercfg -SetDcValueIndex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0
powercfg -SetAcValueIndex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:右键菜单添加用记事本打开
ECHO.
ECHO.
ECHO **********************************
ECHO.
ECHO 右键菜单添加用记事本打开
ECHO.
ECHO 1.添加
ECHO.
ECHO 2.删除
ECHO.
ECHO **********************************
ECHO.
ECHO.
Choice /C 12 /N /M 选择(1、2):
If ErrorLevel 1 If Not ErrorLevel 2 Goto 右键菜单添加用记事本打开
If ErrorLevel 2 If Not ErrorLevel 3 Goto 右键菜单删除用记事本打开
:右键菜单添加用记事本打开
reg add "HKCR\*\shell\Noteped" /ve /d 使用记事本打开 /f
reg add "HKCR\*\shell\Noteped\command" /ve /d "notepad.exe %%1" /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:右键菜单删除用记事本打开
reg delete "HKCR\*\shell\Noteped" /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:右键菜单添加管理员取得所有权
ECHO.
ECHO.
ECHO **********************************
ECHO.
ECHO 右键菜单添加管理员取得所有权
ECHO.
ECHO 1.添加
ECHO.
ECHO 2.删除
ECHO.
ECHO **********************************
ECHO.
ECHO.
Choice /C 12 /N /M 选择(1、2):
If ErrorLevel 1 If Not ErrorLevel 2 Goto 右键菜单添加管理员取得所有权
If ErrorLevel 2 If Not ErrorLevel 3 Goto 右键菜单删除管理员取得所有权
:右键菜单添加管理员取得所有权
>"%temp%\_.reg" echo Windows Registry Editor Version 5.00
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\*\shell\runas]
>>"%temp%\_.reg" echo @="管理员取得所有权"
>>"%temp%\_.reg" echo "NoWorkingDirectory"=""
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\*\shell\runas\command]
>>"%temp%\_.reg" echo @="cmd.exe /c takeown /f \"%%1\" && icacls \"%%1\" /grant administrators:F"
>>"%temp%\_.reg" echo "IsolatedCommand"="cmd.exe /c takeown /f \"%%1\" && icacls \"%%1\" /grant administrators:F"
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\exefile\shell\runas2]
>>"%temp%\_.reg" echo @="管理员取得所有权"
>>"%temp%\_.reg" echo "NoWorkingDirectory"=""
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\exefile\shell\runas2\command]
>>"%temp%\_.reg" echo @="cmd.exe /c takeown /f \"%%1\" && icacls \"%%1\" /grant administrators:F"
>>"%temp%\_.reg" echo "IsolatedCommand"="cmd.exe /c takeown /f \"%%1\" && icacls \"%%1\" /grant administrators:F"
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\Directory\shell\runas]
>>"%temp%\_.reg" echo @="管理员取得所有权"
>>"%temp%\_.reg" echo "NoWorkingDirectory"=""
>>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
>>"%temp%\_.reg" echo @="cmd.exe /c takeown /f \"%%1\" /r /d y && icacls \"%%1\" /grant administrators:F /t"
>>"%temp%\_.reg" echo "IsolatedCommand"="cmd.exe /c takeown /f \"%%1\" /r /d y && icacls \"%%1\" /grant administrators:F /t"
regedit /s "%temp%\_.reg"
del /f /q "%temp%\_.reg"
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:右键菜单删除管理员取得所有权
reg delete "HKCR\*\shell\runas" /f
reg delete "HKCR\exefile\shell\runas2" /f
reg delete "HKCR\Directory\shell\runas" /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:开机磁盘扫描等待时间
set /p shijian=请设置开机磁盘扫描时间(建议设为2秒):
chkntfs /t:%shijian%
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:加快菜单与任务栏预览的显示速度
reg add "HKCU\Control Panel\Desktop" /v MenuShowDelay /d 0 /t REG_SZ /f
reg add "HKCU\Control Panel\Mouse" /v MouseHoverTime /d 0 /t REG_SZ /f
@echo.重启生效,按任意键返回主菜单
pause>nul
cls
GOTO menu
:关闭DEP
bcdedit /set nx alwaysoff
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:清除任务栏历史图标
taskkill /f /im explorer.exe
reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v IconStreams /f
reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v PastIconsStream /f
start explorer
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:清空图标缓存
taskkill /f /im explorer.exe
attrib -h -s -r "%userprofile%\AppData\Local\IconCache.db"
del /f "%userprofile%\AppData\Local\IconCache.db"
start explorer
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:清除右键菜单兼容性疑难解答
reg delete "HKEY_CLASSES_ROOT\lnkfile\shellex\ContextMenuHandlers\Compatibility" /f
reg delete "HKEY_CLASSES_ROOT\exefile\shellex\ContextMenuHandlers\Compatibility" /f
reg delete "HKEY_CLASSES_ROOT\batfile\ShellEx\ContextMenuHandlers\Compatibility" /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:清除右键菜单还原以前的版本
reg delete "HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\PropertySheetHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}" /f
reg delete "HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}" /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:禁用虚拟内存
ECHO.
ECHO.
ECHO ***********************************************************
ECHO.
ECHO 确认内存大于1G且不常使用绘图软件
ECHO.
ECHO 警告:对于大内存机子来说肯定能提升不少性能
ECHO 但是小内存机或者使用占用大量内存的程序就容易各种崩溃了
ECHO.
ECHO 慎用
ECHO.
ECHO 1.执行
ECHO.
ECHO 2.恢复
ECHO.
ECHO ***********************************************************
ECHO.
ECHO.
Choice /C 12 /N /M 选择(1、2):
If ErrorLevel 2 Goto 恢复禁用虚拟内存
If ErrorLevel 1 Goto 执行禁用虚拟内存
:执行禁用虚拟内存
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v DisablePagingExecutive /d 1 /t REG_DWORD /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:恢复禁用虚拟内存
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v DisablePagingExecutive /d 0 /t REG_DWORD /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:关机时强制退出应用程序
ECHO.
ECHO.
ECHO **********************************
ECHO.
ECHO 关机时强制退出应用程序
ECHO.
ECHO 1.设置
ECHO.
ECHO 2.恢复
ECHO.
ECHO **********************************
ECHO.
ECHO.
Choice /C 12 /N /M 选择(1、2):
If ErrorLevel 2 Goto 恢复关机时强制退出应用程序
If ErrorLevel 1 Goto 执行关机时强制退出应用程序
:执行关机时强制退出应用程序
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WaitToKillAppTimeout /d 1000 /t REG_SZ /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:恢复关机时强制退出应用程序
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WaitToKillAppTimeout /d 20000 /t REG_SZ /f
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu
:将U盘转化为ntfs
set /p Upan=请输入U盘的盘符(如H):
convert %Upan%:/fs:ntfs
@echo.操作已完成,按任意键返回主菜单
pause>nul
cls
GOTO menu