Advertisement
Virajsinh

copy file from to using command line.bat

Sep 28th, 2024
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.55 KB | Source Code | 0 0
  1. File Name : file_list.txt
  2.  
  3. "D:\xampp\htdocs\project1\routes\web.php","D:\xampp\htdocs\project2\routes\web.php"
  4. "D:\xampp\htdocs\project1\app\Models\Loan.php","D:\xampp\htdocs\project2\app\Models\Loan.php"
  5. "D:\xampp\htdocs\project1\app\Models\Asset.php","D:\xampp\htdocs\project2\app\Models\Asset.php"
  6.  
  7. File Name : copy_files.bat
  8. @echo off
  9. rem Loop through file_list.txt and copy each file
  10.  
  11. for /f "tokens=1,2 delims=," %%a in (file_list.txt) do (
  12.     echo Copying %%~a to %%~b
  13.     copy /Y %%~a %%~b
  14. )
  15.  
  16. echo All files copied successfully!
  17. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement