qwe1234567斑竹,您刚才发的2000环境下的程序代码怎么不见了?
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
set a=%date:~4,4%%date:~9,2%%date:~12,2%@%time:~0,2%%time:~3,2%%time:~6,2%
ren *.txt *%a%.txt@echo off
set datetime=%~n1%date:~0,4%%date:~5,2%%date:~8,2%@%time:~0,2%%time:~3,2%%time:~6,2%%~x1
echo %1 %datetime%@echo off
set datetime=%~n1%date:~4,4%%date:~9,2%%date:~12,2%@%time:~0,2%%time:~3,2%%time:~6,2%%~x1
echo %1 %datetime%@echo off
if "%1"=="/?" echo 将目标文件名重命名为“源文件名+当前日期+@+时间” &&echo.&&echo 语法: DOS filename &&PING/n 4 127.1>NUL &&exit
if "%1"=="" echo 将目标文件名重命名为“源文件名+当前日期+@+时间” &&echo.&&echo 语法: DOS filename &&PING/n 4 127.1>NUL &&exit
ver|find /i "xp">nul
if not errorlevel 1 set datetime=%~n1%date:~0,4%%date:~5,2%%date:~8,2%@%time:~0,2%%time:~3,2%%time:~6,2%%~x1
ver|find /i "2000">nul
if not errorlevel 1 set datetime=%~n1%date:~4,4%%date:~9,2%%date:~12,2%@%time:~0,2%%time:~3,2%%time:~6,2%%~x1
if "%datetime%"=="" echo 此程序必须在Windows xp或Windows 2000系统上运行 &&ping/n 4 127.1>nul &&exit
echo %1 %datetime%
On Error Resume Next
Set objArgs = WScript.Arguments
If objArgs.Count < 1 Then
WScript.Echo "用鼠标把文件拖到该文件上或带参数运行!"
WScript.Quit
End If
For Each strFile In objArgs
strNewFile = Mid(strFile,1,InStrRev(strFile,".") _
- 1) & Replace(Date,"-","") & "@" _
& Replace(Time,":","") & _
Mid(strFile,InStrRev(strFile,".") )
If Len(Trim(strNewFile)) = 0 Then
strNewFile = strFile & Replace(Date,"-","") & _
"@" & Replace(Time,":","")
End If
ReName strFile , strNewFile
Next
Sub ReName (strFile,strNewFile)
WScript.Echo strFile & vbLf & strNewFile
CreateObject("Scripting.FileSystemObject") _
.MoveFile strFile,strNewFile
End Subset a=%date:~6,4%%date:~0,2%%date:~3,2%@%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%
ren *.txt *%a%.txtOriginally posted by samzj at 2006-10-16 22:53:
各位高手
刚才主管跟我说是在2000 server en 环境下测试的,我copy了下date与time
C:\Documents and Settings\Administrator>date
The current date is: 10/16/2006 Mon
Enter t ...
@echo off
set /p lj=欲处理文件的路径:
set /p wjm=欲处理文件的名称:
copy %lj%%wjm% %lj%%wjm%%date:~10,4%%date:~4,2%%date:~7,2%@%time:~0,2%%time:~3,2%%time:~6,2%.txt| 评分人 | 分数 | 时间 |
|---|---|---|
| — | +4 | 2006-10-17 04:47 |