<# copy desktop.ini recursively #>
Get-ChildItem -Recurse -Directory| foreach { copy "D:\Programs\Media\Media Manager\Filebot\cmdlets\desktop.ini" $_.FullName}
<# set folder attribute readonly recursively #>
Get-ChildItem -Recurse -Directory| foreach {$_.Attributes = 'readonly'}
<# set attribute readonly for desktop.ini recursively #>
Get-ChildItem -Recurse -include *.ini| foreach {$_.Attributes = 'readonly,hidden'}
<# set attribute hidden for folder.ico recursively #>
Get-ChildItem -Recurse -include *.ico| foreach {$_.Attributes = 'hidden'}
This powershell script will
- Add desktop.ini in each subfolder
- Set some attributes
It works as intented if I excute the script inside a .bat file along other things
powershell.exe -noprofile -executionpolicy bypass -Command "D:\Programs\Media\'Media Manager'\c.ps1"
THE PROBLEM
I want to add the folders where this script should works, either to the .ps1 or in the .bat whatever possible
For example D:\folder one
& D:\folder two