欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

可以實(shí)現(xiàn)系統(tǒng)自動(dòng)關(guān)機(jī)的批處理

 更新時(shí)間:2007年05月15日 00:00:00   作者:  
@ECHO off
TITLE 自動(dòng)關(guān)機(jī)程序 作者:廖曉青

:start
CLS
COLOR 1f
rem 使用COLOR命令對(duì)控制臺(tái)輸出顏色進(jìn)行更改
MODE con: COLS=41 LINES=18
rem MODE語句為設(shè)定窗體的寬和高
set tm1=%time:~0,2%
set tm2=%time:~3,2%
set tm3=%time:~6,2%
ECHO %date% %tm1%點(diǎn)%tm2%分%tm3%秒
ECHO =========================================
ECHO 請(qǐng)選擇要進(jìn)行的操作,然后按回車
ECHO ───────────────
ECHO.
ECHO 1. 定時(shí)關(guān)機(jī)
ECHO 2. 倒計(jì)時(shí)關(guān)機(jī)
ECHO 3. 刪除定時(shí)關(guān)機(jī)任務(wù)
ECHO 4. 查看任務(wù)狀態(tài)
ECHO 5. 刷新當(dāng)前時(shí)間
ECHO 6. 重新啟動(dòng)
ECHO 7. 鎖定計(jì)算機(jī)
ECHO 8. 注銷
ECHO 9. 退出
ECHO.

:cho 
SET Choice=
SET /P Choice=選擇:
rem 設(shè)定變量"Choice"為用戶輸入的字符
IF NOT "%Choice%"=="" SET Choice=%Choice:~0,1%
rem 如果輸入大于1位,取第1位,比如輸入132,則返回值為1
ECHO.
IF /I "%Choice%"=="1" GOTO SetHour
IF /I "%Choice%"=="2" GOTO outtime
IF /I "%Choice%"=="3" GOTO delAt
IF /I "%Choice%"=="4" GOTO view
IF /I "%Choice%"=="5" GOTO start
IF /I "%Choice%"=="6" GOTO restart
IF /I "%Choice%"=="7" GOTO lock
IF /I "%Choice%"=="8" GOTO logoff
IF /I "%Choice%"=="9" GOTO end
rem 為避免出現(xiàn)返回值為空或含空格而導(dǎo)致程序異常,需在變量外另加雙引號(hào)
rem 注意,IF語句需要雙等于號(hào)
rem 如果輸入的字符不是以上數(shù)字,將返回重新輸入
ECHO 選擇無效,請(qǐng)重新輸入
ECHO.
GOTO cho

:SetHour
CLS
ECHO.
SET ask=
SET /p ask=是否設(shè)定為每天執(zhí)行關(guān)機(jī)命令(y/n):
IF NOT "%ask%"=="" SET ask=%ask:~0,1%
IF /I "%ask%"=="y" GOTO yes
IF /I "%ask%"=="n" GOTO no
GOTO SetHour

:yes
ECHO 請(qǐng)指定24小時(shí)制式時(shí)間,格式為 小時(shí):分鐘
SET shutdowntime=
SET /p shutdowntime=輸入:
at %shutdowntime% /every:M,T,W,Th,F,S,Su tsshutdn 0 /delay:0 /powerdown >nul
rem 設(shè)定為每周的星期一至星期日,即為每天
IF NOT errorlevel 1 GOTO ok
rem 如果輸入正確,就執(zhí)行ok段的語句
ECHO %shutdowntime% 不是標(biāo)準(zhǔn)的時(shí)間格式,請(qǐng)重新輸入
ECHO.
GOTO yes

:no
ECHO 請(qǐng)指定24小時(shí)制式時(shí)間,格式為 小時(shí):分鐘
SET shutdowntime=
SET /p shutdowntime=輸入:
at %shutdowntime% tsshutdn 0 /delay:0 /powerdown >nul
IF NOT errorlevel 1 GOTO ok
ECHO %shutdowntime% 不是標(biāo)準(zhǔn)的時(shí)間格式,請(qǐng)重新輸入
ECHO.
GOTO no

:ok
ECHO.
SET h=%shutdowntime:~1,1%
SET ah=%shutdowntime:~0,1%
SET am=%shutdowntime:~2,2%
SET bh=%shutdowntime:~0,2%
SET bm=%shutdowntime:~3,2%
IF "%h%"==":" (
SET HM=%ah%時(shí)%am%分
) ELSE (
SET HM=%bh%時(shí)%bm%分)
rem 如果輸入h:mm則HM=h時(shí)mm分,否則HM=hh時(shí)mm分 
IF /I "%ask%"=="y" ECHO 系統(tǒng)將于每天的%HM%關(guān)閉
IF /I "%ask%"=="n" ECHO 系統(tǒng)將于%HM%關(guān)閉
ECHO 設(shè)定完畢! 按任意鍵繼續(xù)...
PAUSE >nul
GOTO start

:outtime
CLS
ECHO.
ECHO 請(qǐng)輸入倒計(jì)時(shí)秒數(shù)
ECHO ────────
ECHO (設(shè)定后要取消,單擊"確定"后按Ctrl+C鍵兩次)
SET timed=
SET /p timed=輸入:
tsshutdn %timed% /delay:0 /powerdown >nul
IF not errorlevel 1 GOTO ok
ECHO %timed% 是無效的關(guān)機(jī)時(shí)間,請(qǐng)重新輸入
ECHO.
GOTO outtime

:delAt
cls
echo.
at /del /y
echo 定時(shí)關(guān)機(jī)任務(wù)已取消,按任意鍵繼續(xù)...
pause >nul
GOTO start

:view
MODE con: COLS=85 LINES=18
COLOR 70
ECHO.
at
ECHO 按任意鍵繼續(xù)...
PAUSE >nul
GOTO start

:restart
shutdown -r -t 0

:lock
rundll32.exe user32.dll,LockWorkStation
goto start

:logoff
logoff

:end
exit

相關(guān)文章

最新評(píng)論