Retrieve file attributes from windows cmd

前端 未结 1 1424
北荒
北荒 2021-01-19 00:05

Because node.js doesn\'t offer a way to retrieve and modify the file attributes on windows I need to execute a child process. I want to get all the file attributes, that is:

相关标签:
1条回答
  • 2021-01-19 00:48

    You already answered yourself.But there's a way to read some file attributes with a batch file :

    c:\>for /f %A in ("example.file") do echo %~aA
    

    of in a batch script:

    for /f %%A in ("example.file") do echo %%~aA
    

    or with ATTRIB:

    c:\>attrib + semitest.bat /s /d
    

    where the atributes are:

        R  Read-only (1)
        H  Hidden (2)
        A  Archive (32)
        S  System (4)
    

    extended attributes:

        E  Encrypted
        C  Compressed (128:read-only)
        I  Not content-indexed
        L  Symbolic link/Junction (64:read-only)
        N  Normal (0: cannot be used for file selection)
        O  Offline
        P  Sparse file
        T  Temporary 
    
    0 讨论(0)
提交回复
热议问题