How do I change a file's attribute using Powershell?

后端 未结 6 1686
抹茶落季
抹茶落季 2021-02-05 05:07

I have a Powershell script that copies files from one location to another. Once the copy is complete I want to clear the Archive attribute on the files in the source location t

6条回答
  •  别那么骄傲
    2021-02-05 05:20

    You can use the good old dos attrib command like this:

    attrib -a *.*
    

    Or to do it using Powershell you can do something like this:

    $a = get-item myfile.txt
    $a.attributes = 'Normal'
    

提交回复
热议问题