Quantcast
Viewing all articles
Browse latest Browse all 21975

Date Stamp and Move Files

All

I have the below script which date stamps a file and moves it into the folder where the script is. However, I want to move it to a specific folder c:\archive can you help?

Get-ChildItem "c:\text\*.txt" | ForEach-Object {         
    Move-Item $_.FullName "$BackupFolder$($_.BaseName -replace " ", "_" -replace '\..*?$')$(Get-Date -Format "ddMMyyyy").txt"
}


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>