标题: 将当前时间、日期、版本号等存到环境变量中
[打印本页]
作者: LYDONG
时间: 2003-6-26 00:00
标题: 将当前时间、日期、版本号等存到环境变量中
这个文件是MYS发表过的,我只是做了少许修改。可以将当前的时间、日期、盘符、路径、版本号等存到环境变量中,使用也很方便的。只需将以下内容存为GET.BAT即可使用。直接输入GET[回车]可查看帮助信息。
----------------
::get.bat
@if [%2]==[] goto help
@if [%1]==[/?] goto help
@if [%1]==[/h] goto help
@if [%1]==[invoke] prompt set %2=%3$_
@if [%1]==[invoke] goto end
@if [%temp%]==[] set temp=c:
@%comspec% /c %0 invoke %1 $%2>%TEMP%\tt.bat
@echo off
call %TEMP%\tt.bat
if "%3"=="" DEL %TEMP%\tt.bat
set CMDLINE=
goto end
:help
@echo off
echo.
echo GET.BAT V1.0 Lydong 030625
echo ===============================
echo get curver [Command]
echo get [/?] or [/h]
echo.
echo eg: get time t
echo get dosver v
echo.
echo Command:
echo T Current time
echo D Current date
echo P Current drive and path
echo V Windows version number
echo N Current drive
echo ===============================
echo.
:end