![[ 命令提示字元 ]如何利用 attrib.exe 指令,隱藏檔案或資料夾?](https://key.chtouch.com/ReadImage.ashx?OBlogPhotoItems=18222)
想要在 Windows 系統內隱藏檔案或資料夾,有些人會使用像是 Free Hide Folder 工具協助,若偶而使用時,其實可以利用 Windows 系統內建的 attrib 指令,便可改變檔案或資料夾的屬性,達到隱藏檔案或資料夾的目地,不過使用這種方法也並非萬無一失,須注意較容易被其他人取消隱藏的屬性,而顯示出受保護的檔案或資料夾,可參閱 [ Windows]如何顯示檔案的副檔名及被隱藏保護的檔案。
如何使用 attrib.exe 指令,隱藏檔案或資料夾?
1.開啟「命令提示字元」,輸入 attrib /? 後,按下鍵盤的 Enter 鍵,便可列出相關參數用法。
![[ 命令提示字元 ]如何利用 attrib.exe 指令,隱藏檔案或資料夾?](/ReadImage.ashx?OBlogPhotoItems=18222)
2.假設 d 磁碟機下有一 privatephoto 資料夾,我們想對其隱藏,便可以使用 attrib.exe +S +H D:\privatephoto 指令,可參考如下範例。
![[ 命令提示字元 ]如何利用 attrib.exe 指令,隱藏檔案或資料夾?](/ReadImage.ashx?OBlogPhotoItems=18223)
3.若要刪除該屬性,同樣指令 + 改成 - 號即可。
![[ 命令提示字元 ]如何利用 attrib.exe 指令,隱藏檔案或資料夾?](/ReadImage.ashx?OBlogPhotoItems=18224)
4.如果資料夾名稱內含有空格時,例如 D:\private photo 則需要使用雙引號刮住成 attrib.exe +S +H "D:\private photo"。
![[ 命令提示字元 ]如何利用 attrib.exe 指令,隱藏檔案或資料夾?](/ReadImage.ashx?OBlogPhotoItems=18225)