relative path in BAT script

后端 未结 5 1469
囚心锁ツ
囚心锁ツ 2020-12-22 16:44

Here is my own program folder on my USB drive:

Program\\
     run.bat
     bin\\
         config.ini
         Iris.e         


        
5条回答
  •  一整个雨季
    2020-12-22 17:17

    You can get all the required file properties by using the code below:

    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:?
    )
    

提交回复
热议问题