temp 发表于 2010-2-10 23:38

[备用]限制更改系统时间

本帖最后由 ssqj111 于 2012-6-18 11:37 编辑

无意中看到的,未测试,这里空闲,留做备用
:::: 限制用户更改系统时间 By FastSLZ 2009-6-1 CMD WinXP SP2 or WinXP SP3
@echo off&SetLocal EnableDelayedExpansion
set "SecPath=%WINDIR%\security\Database"
cd.>"%SecPath%\sec.cfg"
if not exist "%SecPath%\sec.bak" secedit /export /cfg "%SecPath%\sec.bak" /quiet
for /f "delims=" %%i in ('type "%SecPath%\sec.bak"') do (
set "var=%%i"
if "!var:~0,21!"=="SeSystemtimePrivilege" (>>"%SecPath%\sec.cfg" echo SeSystemtimePrivilege =) else >>"%SecPath%\sec.cfg" echo/!var!
)
secedit /configure /db "%SecPath%\sec.sdb" /cfg "%SecPath%\sec.cfg" /quiet
gpupdate /force >nul
echo 重启生效!&pause>nul
@echo off
::::还原系统时间可更改状态
secedit /configure /db "%SecPath%\sec.sdb" /cfg "%SecPath%\sec.bak" /quiet
gpupdate /force >nul
echo 重启生效!&pause>nul




页: [1]
查看完整版本: [备用]限制更改系统时间