I would like to create a batch file to copy list of files and folder from source to destination. Here is the list of checks to be considered before copying. I am not aware of batch file coding. Please help.
- Source location should read from batch (set /p source= enter input dir: C: \Desktop\ Junk)
- Destination location is constant server location (example \ \Network\Team\Destination) and inside destination folder, folder to be created by considering source folder name with computer user name as prefix i.e., ComputerUserName_Junk folder . \Network\Team\Destination\ ComputerUserName_Junk
- Start copy the specified data present in source including sub folders data.
Example C:\Desktop\ Junk \ folder has
C:\Desktop\Junk C:\Desktop\Junk\Subfolder A 1.txt 2.exe C:\Desktop\Junk\Subfolder B C:\Desktop\Junk\Subfolder B\Subfolder C 3.txt 4.exe 5.txt 6.dll 7.txt 8.exe 9.txt C:\Desktop\Junk\Subfolder C C:\Desktop\Junk\Subfolder D
- I need complete data present in Subfolder A(1.txt and 2.exe) to Destination folder \Network\Team\Destination\ComputerUserName_Junk\ Subfolder A .
- I need only files with extension of *.txt in Subfolder B (i.e. 7.txt and 9.txt) to \Network\Team\Destination\ComputerUserName_Junk\ Subfolder B .
- I need specific file names 4.exe and 6.dll to \Network\Team\Destination\ComputerUserName_Junk\ Subfolder B\Subfolder C .
Output/Destination folder should look like this: \Network\Team\Destination\ComputerUserName_Junk
Subfolder A 1.txt 2.exe Subfolder B Subfolder C 4.exe 6.dll 7.txt 9.txt