Solved Batch move file into folder based on last 4 digits of folder

April 28, 2020 at 13:25:03
Specs: Windows 10
Hello
We want to use a batch file to move files into a folder based on the last 4 digits (project #) of the folder proceeded by a dash.
Example folder path/name could be
O:\MT. Laurel - EMS Building - -Mt Laurel-9136
The user will enter the project # 9136.

Thank you


See More: Batch move file into folder based on last 4 digits of folder

Reply ↓  Report •

#1
April 28, 2020 at 23:42:09
does it need to be drag & drop?

where is the folder i'm supposed to drop the files? (you can replace the user name with %USERNAME%)

specs: https://www.userbenchmark.com/UserR...


Reply ↓  Report •

#2
April 29, 2020 at 06:41:49
We do not want to drag and drop. Looking for user to run a cmd/batch file that will prompt the user for the project # that will correlate with the folder name that the fill will moved into. The originating folder will always be the same.

Reply ↓  Report •

#3
April 29, 2020 at 14:36:24
✔ Best Answer
Does it have to be a batch script?
Could use powershell:

$Project = Read-Host -Prompt "Enter Project ID"

Get-ChildItem -Path "insert path here" -Recurse -Filter "*$Project*" | Copy-Item -Destination "insert path here"


Reply ↓  Report •

Related Solutions

#4
May 1, 2020 at 06:14:30
This idea may work for us.

Thank you!


Reply ↓  Report •

Ask Question