Minggu, 08 Maret 2020

Get File attributes using batch script

Hi, batch programmers,
In this tutorial, we will get some file properties using batch script.
Attributes are:

  1. File name only
  2. Extension only


FOR %%? IN ("C:\somefile\path\file.txt") 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 Drive and Path : %%~dp? ECHO Drive : %%~d? ECHO Fully Qualified Path : %%~f? ECHO FQP in 8.3 notation : %%~sf? ECHO Location in the PATH : %%~dp$PATH:? )

Tidak ada komentar:

Posting Komentar