Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get-ChildItem g:\old*.mp4 -Recurse | foreach {
- $x = $_.LastWriteTime.ToShortDateString()
- $new_folder_name = Get-Date $x -Format yyyy.MM.dd
- $des_path = "g:\old\$new_folder_name"
- if (test-path $des_path){
- move-item $_.fullname $des_path
- } else {
- new-item -ItemType directory -Path $des_path
- move-item $_.fullname $des_path
- }
- }
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement