Answer the question
In order to leave comments, you need to log in
How to make a script to transfer files?
Good day.
Please help with the script. Something didn't work out for me. (can you tell me where to google)
The directory contains the files name, name-f, name1, name1-f name2-a name2 name3-f name3 , etc.
Only the name-f name files need to be transferred to another directory. That is, files with "-a" and their corresponding names should be left.
Began so:
find *-f > files.txt
What further to do with it - not clearly.
In theory, you need to discard -f, insert into the search string what happened line by line, and transfer what it finds.
In general, please help.
OS Windows 7
Answer the question
In order to leave comments, you need to log in
PowerShell
Get-Childitem d:\test\*-f.* | Move-Item -Destination d:\test\test
Get-ChildItem d:\test\test\*-f.* | Rename-Item -Newname {$_.name -replace "-f",""}
Run PowerShell - there is a default in the seven and run in the source folder:
Get-ChildItem -Filter *.-f -File | Move-Item -Destination "c:\destination" , with the correct path to the folder to move to.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question