Moving files to appropriate location based on their extension
问题 I have a cleanup script that moves files based on their extension to appropriate preset locations. For example, a file with the extension .xls will be moved to ~\XLS folder, .sql to ~\SQL and so on. Here is the my script. $dirtyfolder = "\\server\c$\Documents and Settings\user\Desktop\" $org = "\\BACKUPS\users\" dir $dirtyfolder -fil *.doc | mv -dest "$($org)ORG\doc" dir $dirtyfolder -fil *.txt | mv -dest "$($org)ORG\txt" dir $dirtyfolder -fil *.sql | mv -dest "$($org)ORG\sql" dir