|
2#
楼主 |
发表于 2021-6-29 18:23:27
|
只看该作者
本帖最后由 yjqd 于 2021-6-29 19:49 编辑
还是那些高手厉害
一个文件搞定
把下面保存为批处理
::On Error Resume Next
:Sub bat
echo off & cls
echo '>nul & set /p a=请输入文件路径:
echo '>nul & start "" wscript //e:vbscript "%~f0" %* /b:%a%
Exit Sub : End Sub
Set Wshnamed=wscript.arguments.named
Va = Wshnamed.item("b")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(va)
MsgBox va&vbLf &vbLf &"创建时间:" & objFile.DateCreated & vbLf & "修改时间:" & objFile.DateLastModified
Set objFile = Nothing
Set objFSO = Nothing
或者
echo '>nul & start "" wscript //e:vbscript "%~f0" %* /b:%a%替换为:
echo '>nul & for /f "delims=" %%a in ('cscript //Nologo //e:vbscript "%~f0" %* /b:%a%') do echo.&echo %%a
echo '>nul & echo.
pause
MsgBox 替换为:wscript.echo
|
|