How to get file's last modified date on Windows command line?

前端 未结 8 1638
星月不相逢
星月不相逢 2020-12-01 04:16

I have been using the following command to get the file date. However, the fileDate variable has been returning blank value ever since we moved to a different s

8条回答
  •  悲&欢浪女
    2020-12-01 04:28

    you can get a files modified date using vbscript too

    Set objFS=CreateObject("Scripting.FileSystemObject")
    Set objArgs = WScript.Arguments
    strFile= objArgs(0)
    WScript.Echo objFS.GetFile(strFile).DateLastModified
    

    save the above as mygetdate.vbs and on command line

    c:\test> cscript //nologo mygetdate.vbs myfile
    

提交回复
热议问题