
[分享]批處理日記記錄器做的不太好,大家可以幫忙改改
nclick="copycode($('code0'));">復制代碼
- @echo off
- if exist 日記庫 goto start
- md 日記庫
- attrib 日記庫 +s +h
- echo [.ShellClassInfo]>日記庫desktop.ini
- echo CLSID={21EC-3AEA-1069-A2DD-08002B30309D}>>日記庫desktop.ini
- attrib 日記庫desktop.ini +s +h +r
- :start
- set sr=
- set /p sr=請輸入進入密碼:
- if '%sr%'=='2000728' goto gly
- echo 密碼錯誤,請重新輸入。
- goto start
- :gly
- cd 日記庫
- :cc
- cls
- if not exist *.ma echo當前無日記,請先記日記&goto g2m
- echo.
- call :current_user
- echo.
- :g2m
- set mz=
- set /p mz= [1]記日記 [2]查看日記 [3]刪除日記 [q]退出:
- if '%mz%'=='1' goto jrj
- if '%mz%'=='2' goto ckrj
- if '%mz%'=='3' goto del
- if '%mz%'=='q' exit
- goto cc
- :current_user
- echo當前日記列表:
- echo-----------------------------
- for /f %%i in ('dir /b *.ma') do (
- echo%%~ni
- )
- echo-----------------------------
- goto :eof
- :jrj
- cls
- set jr=
- set /p jr=是使用 當前日期y 還是自輸日期(格式:nn月nn日):
- if '%jr%'=='y' set times=%date:~5,2%月%date:~8,2%日&goto srjj
- set times=%jr%
- :srjj
- echo 請輸入日記內容,回車結束:
- set rjnr=
- set /p rjnr=
- echo.>>%times%的日記.ma
- echo 日期:%times%時間:%time:~0,2%點%time:~3,2%分%time:~6,2%秒>>%times%的日記.ma
- echo %rjnr%>>%times%的日記.ma
- goto cc
- :ckrj
- set ckjj=
- set /p ckjj= 請輸入日記名稱后回車:
- more %ckjj%.ma
- echo 按任意鍵返回
- pause>nul
- goto cc
- :del
- set ckjj=
- set /p ckjj= 請輸入日記名稱后回車:
- del /f %ckjj%.ma
- echo 按任意鍵返回
- pause>nul
- goto cc

