• cmd 창에서 파일 속성 변경하기 - ATTRIB

    2018. 8. 30.

    by. Yo.

    728x90


    ATTRIB 명령어를 사용하면 파일의 속성을 변경할 수 있습니다.


    우선 이 옵션을 찾아보게 된 계기가...


    여러위치에 위치한 파일들의 읽기 전용 속성을 일괄 변경하기 위함이었습니다.



    패치파일을 하나 생성 한뒤 r 옵션을 적용하는데 매우 간단 명료하게 

    - , + 로 옵션을 적용 해제 합니다.


    # 읽기전용 해제 시 
    attrib -r "파일경로 및 파일명"

    #읽기전용 적용 시
    attrib +r "파일경로 및 파일명"




    프롬프트창에서 확인 가능한 상세 옵션입니다.


    (c) 2017 Microsoft Corporation. All rights reserved.


    C:\Users\Administrator>Attrib /?

    Displays or changes file attributes.


    ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [+O | -O] [+I | -I] [+P | -P] [+U | -U]

           [drive:][path][filename] [/S [/D]] [/L]


      +   Sets an attribute.

      -   Clears an attribute.

      R   Read-only file attribute.

      A   Archive file attribute.

      S   System file attribute.

      H   Hidden file attribute.

      O   Offline attribute.

      I   Not content indexed file attribute.

      X   No scrub file attribute.

      V   Integrity attribute.

      P   Pinned attribute.

      U   Unpinned attribute.

      [drive:][path][filename]

          Specifies a file or files for attrib to process.

      /S  Processes matching files in the current folder

          and all subfolders.

      /D  Processes folders as well.

      /L  Work on the attributes of the Symbolic Link versus

          the target of the Symbolic Link



    C:\Users\Administrator>




    728x90

    댓글