FOR %%? IN (file_to_be_queried) DO (
ECHO File Name Only : %%~n?
ECHO File Extension : %%~x?
ECHO Name in 8.3 notation : %%~sn?
ECHO File Attributes : %%~a?
ECHO Located on Drive : %%~d?
ECHO File Size : %%~z?
ECHO Last-Modified Date : %%~t?
ECHO Parent Folder : %%~dp?
ECHO Fully Qualified Path : %%~f?
ECHO FQP in 8.3 notation : %%~sf?
ECHO Location in the PATH : %%~dp$PATH:?
)
我在http://www.robvanderwoude.com/battech_fileproperties.php看到了这个。
但是当我尝试应用它时,在循环中我使用“set”
SET datetime_t = %%~t?
回显 datetime_t %datetime_t% > result.txt
在文件里面只显示
datetime_t
datetime_t
datetime_t
datetime_t
这个变量发生了什么?它是空的吗?