How to copy file through Batch file

Dec 25, 2018
4
0
10
Hi,
I'm trying to copy files and move to destination folder. Eg file name as 1000000000001678_DP_MASTER_2018122412081000_F_Done.txt
Which I wanna transfer to destination folder.
Only problem is file name keeps on changing other than Dp_MASTER_ remains same all the time.
In such case how to transfer file through Batch file.
 
Solution
First, you'll need to create the list of files to copy. This DOS command will do that for you:

dir /B C:\MYFILEPATH\*_DP_MASTER_*.txt > copyfile.txt

This can be inserted into the eventual batch file right after the "@echo off" command and will need to be updated with the correct file path.

There are some variations on how to do it. This should give you some ideas to get started.

Let Me Google That For You Link

-Wolf sends

Wolfshadw

Titan
Moderator
First, you'll need to create the list of files to copy. This DOS command will do that for you:

dir /B C:\MYFILEPATH\*_DP_MASTER_*.txt > copyfile.txt

This can be inserted into the eventual batch file right after the "@echo off" command and will need to be updated with the correct file path.

There are some variations on how to do it. This should give you some ideas to get started.

Let Me Google That For You Link

-Wolf sends
 
Solution
Dec 25, 2018
4
0
10
MERGED QUESTION
Question from warriorsam88 : "How to copy file through Batch file"

Hi,
I'm trying to copy files and move to destination folder. Eg file name as 1000000000001678_DP_MASTER_2018122412081000_F_Done.txt
Which I wanna transfer to destination folder.
Only problem is file name keeps on changing other than Dp_MASTER_ remains same all the time.
In such case how to transfer file through Batch file.