让电脑密码自动更改并控制小朋友上网时间

小朋友在家上网无节制,所以写了这样一个东西,让小朋友用电脑之前需要做一道算术题才能获得密码,并且关机后再开机密码变更 。  程序本身比较粗糙,不过还挺好用。 

适用系统: winXP/win7  win8未试过,想来也是能用的吧
ram 判断日期并更改密码
ram change password
msg * "请先等候10秒钟"
echo wscript.sleep 10000 > c:\sleep.vbs
c:\sleep.vbs

set yesno=%date%
for /f %%j in (c:\date.txt) do if not "%yesno:~,10%" == "%%j" goto normol
if exist c:\shutdown.txt goto once
:normol
del c:\shutdown.txt
del c:\date.txt
set aaaa=%date:~0,4%%date:~5,2%%date:~8,2%
set /a aaaa=(%aaaa% - ********) /%date:~8,2% /4
net user administrator %aaaa%
echo %aaaa% > c:\pwd.txt
set /a tih=%time:~,2%
set /a thm=%time:~3,2%
set /a thnewh=%tih%+3
set /a thnewt=%thnewh% * 60 + %thm%
echo %thnewt% > c:\login.time

ram add a schedule
shutdown -s -t 5400 -c "使用1个半小时将关机“ 

echo a > c:\shutdown.txt
echo %date% >c:\date.txt

goto end
:once
set /a tih=%time:~,2%
set /a thm=%time:~3,2%
set /a thnewh=%tih%+3
set /a thnewt=%thnewh% * 60 + %thm%
for /f %%i in (c:\login.time) do set /a panduan=%%i
set /a timec=%thnewt% - %panduan%

set /a remane=270 - %timec%

if 270 gtr %timec% (
msg * "被使用过后还未等待三小时,密码还未恢复 , 还剩余时间 %remane%分钟“
msg * "一分钟后电脑自动关机"
net user administrator ********
shutdown -s -t 60
) else (
goto normol
)


:end

if not exist %windir%\System32\GroupPolicy\Machine\Scripts\Startup\limit.bat move limit.bat %windir%\System32\GroupPolicy\Machine\Scripts\Startup\limit.bat
 
更改成at控制shutdown,xp中窗口无法隐藏
请输入内容
ram 判断日期并更改密码
ram change password
echo wscript.sleep 10000 > c:\sleep.vbs
c:\sleep.vbs

set yesno=%date%
for /f %%j in (c:\date.txt) do if not "%yesno:~,10%" == "%%j" goto normol
if exist c:\shutdown.txt goto once
:normol
del c:\shutdown.txt
del c:\date.txt
set aaaa=%date:~0,4%%date:~5,2%%date:~8,2%
set /a aaaa=(%aaaa% - 9999) /%date:~8,2% /4
net user administrator %aaaa%
echo %aaaa% > c:\pwd.txt
set /a tih=%time:~,2%
set /a thm=%time:~3,2%
set /a thnewh=%tih%+3
set /a thnewt=%thnewh% * 60 + %thm%
echo %thnewt% > c:\login.time
set /a shuttimeh=%thnewt% / 60
set /a shuttimem=%thnewt% %% 60
at %shuttimeh%:%shuttimem% shutdown -s -t 0 -f
 

echo a > c:\shutdown.txt
echo %date% >c:\date.txt

goto end
:once
set /a tih=%time:~,2%
set /a thm=%time:~3,2%
set /a thnewh=%tih%+3
set /a thnewt=%thnewh% * 60 + %thm%
for /f %%i in (c:\login.time) do set /a panduan=%%i
set /a timec=%thnewt% - %panduan%

set /a remane=270 - %timec%

if 270 gtr %timec% (
msg * "被使用过后还未等待三小时,密码还未恢复 , 还剩余时间 %remane%分钟“
msg * "一分钟后电脑自动关机"
net user administrator password
shutdown -s -t 60
) else (
goto normol
)
 

:end

if not exist %windir%\System32\GroupPolicy\Machine\Scripts\Startup\limit.bat move
limit.bat %windir%\System32\GroupPolicy\Machine\Scripts\Startup\limit.bat

你可能感兴趣的:(密码,电脑,小朋友,在家,算术题)