win7下一些常用的配置脚本命令

::任务计划每周二4点重启

schtasks /create /ru "system" /tn restart /tr "shutdown.exe -r" /sc weekly /d TUE /st 04:00 /f

::删除任务计划
schtasks /delete /tn restart /f
::IP设置为固定IP
netsh interface ip set address "本地连接" static 192.168.1.8 255.255.255.0 192.168.1.1
::DNS
netsh interface ip set dns "本地连接" static 192.168.1.1 primary
::IP设置为动态IP
netsh interface ip set address "本地连接" source=dhcp
::DNS
netsh interface ip set dns "本地连接" source=dhcp
::系统异常重启不启动修复
bcdedit /set {default} bootstatuspolicy ignoreallfailures
bcdedit /set {current} recoveryenabled No
::系统异常重启启动修复
bcdedit /set {default} bootstatuspolicy displayallfailures
::关闭windows防火墙
netsh advfirewall set publicprofile state off
netsh advfirewall set privateprofile state off
::启动windows防火墙
netsh advfirewall set publicprofile state on
netsh advfirewall set privateprofile state on
::关闭自动更新
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t reg_dword /d 1 /f
::打开自动更新
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t reg_dword /d 4 /f
::电源选项-显示器关闭时间
powercfg /change monitor-timeout-ac 0
::电源选项-硬盘关闭时间
powercfg /change disk-timeout-ac 0
::电源选项-睡眠时间
powercfg /change standby-timeout-ac 0
::电源选项-休眠时间
powercfg /change hibernate-timeout-ac 0
::关闭UAC
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v ConsentPromptBehaviorAdmin /t reg_dword /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t reg_dword /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v PromptOnSecureDesktop /t reg_dword /d 0 /f
::开启UAC
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v ConsentPromptBehaviorAdmin /t reg_dword /d 5 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t reg_dword /d 1 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v PromptOnSecureDesktop /t reg_dword /d 1 /f

你可能感兴趣的:(win7)