Batch file to copy 3 files to new directory

jewjitsu

I have 100 Profiles that I need the cookies imported to a new folder, currently I'm using xcopy but is there a cleaner way to do it than this for the 3 files (Bookmarks, Cookies and Cookies-journal are the names)

Folders are named the same, I just need to copy the files from Profile 1 Directory 1 to Profile 1 Directory 2 - but 100 directories in order:

xcopy "C:\Users\Switch\Desktop\UserData\Profile 7\Bookmarks" "C:\Users\switch\AppData\Local\Chromium\User Data\Profile 7" /i /y

xcopy "C:\Users\Switch\Desktop\UserData\Profile 7\Cookies" "C:\Users\switch\AppData\Local\Chromium\User Data\Profile 7" /i /y

xcopy "C:\Users\Switch\Desktop\UserData\Profile 7\Cookies-journal" "C:\Users\switch\AppData\Local\Chromium\User Data\Profile 7" /i /y

Bloodied

Next time please give some kind of attempt, but, either way, a nested for loop should do the trick.

@echo off
for /l %%G in (0,1,99) do (
    for %%H in (Bookmarks Cookies Cookies-journal) do (
        xcopy "C:\Users\Switch\Desktop\UserData\Profile %%~G\%%~H" "C:\Users\switch\AppData\Local\Chromium\User Data\Profile %%~G" /i /y
    )
)

The first for loop, for /l %%G goes from 0-->99,

The second indented one for %%H goes through each of the file names mentioned,

Then put the current profile number %%~G, and the current file %%~H into the xcopy command as they belong.


Note, the for /l %%G loop starts with a Profile 0, if this isn't desired, just use (firstNumber,amountToAddEachLoop,lastNumber) for example (1,1,100) to go from 1-->100

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Copy files from Ftp to local directory using batch file

From Dev

Windows Batch file to copy latest files to a new folder

From Dev

Python copy files to a new directory and rename if file name already exists

From Dev

Copy and Rename Files with batch file

From Dev

Batch file to copy and rename files

From Dev

Copy file from batch file's directory

From Dev

Copy files to directory with random name with batch

From Dev

Copy file into new directory (PHP)

From Dev

CMD Batch File to Read Files in Directory and Create new files with Content from the Name

From Dev

Batch: Copy files from txt file to folder, and place diffrences in new file

From Dev

How do I copy files recursively through a directory tree while appending parent folder names to the new files? Batch or VBScript

From Dev

How do I copy files recursively through a directory tree while appending parent folder names to the new files? Batch or VBScript

From Dev

Copy Files from one directory to another while creating a new folder for each file, named after the file

From Dev

Copy file and file structure and merge in new directory

From Dev

Copy *changed/new files only* to a DIFFERENT directory?

From Dev

Find, rename and copy files to a new directory

From Dev

rsync: copy updated/new files to DIFFERENT directory

From Dev

Copy files in one file with filename using Batch

From Dev

Write a batch file to repeatedly copy files

From Dev

Copy files in one file with filename using Batch

From Dev

Batch find and copy files from a file list

From Dev

Copy files based on timestamp in a batch file

From Dev

batch file to copy files to specified folders

From Dev

batch file to copy files based on their names

From Java

Batch File; List files in directory, only filenames?

From Dev

Batch File To Convert All Files In Directory To ATF

From Dev

Copy the file directory and files using Gulp

From Dev

Copy the file directory and files using Gulp

From Dev

batch file failed and cannot copy file from one directory to another

Related Related

  1. 1

    Copy files from Ftp to local directory using batch file

  2. 2

    Windows Batch file to copy latest files to a new folder

  3. 3

    Python copy files to a new directory and rename if file name already exists

  4. 4

    Copy and Rename Files with batch file

  5. 5

    Batch file to copy and rename files

  6. 6

    Copy file from batch file's directory

  7. 7

    Copy files to directory with random name with batch

  8. 8

    Copy file into new directory (PHP)

  9. 9

    CMD Batch File to Read Files in Directory and Create new files with Content from the Name

  10. 10

    Batch: Copy files from txt file to folder, and place diffrences in new file

  11. 11

    How do I copy files recursively through a directory tree while appending parent folder names to the new files? Batch or VBScript

  12. 12

    How do I copy files recursively through a directory tree while appending parent folder names to the new files? Batch or VBScript

  13. 13

    Copy Files from one directory to another while creating a new folder for each file, named after the file

  14. 14

    Copy file and file structure and merge in new directory

  15. 15

    Copy *changed/new files only* to a DIFFERENT directory?

  16. 16

    Find, rename and copy files to a new directory

  17. 17

    rsync: copy updated/new files to DIFFERENT directory

  18. 18

    Copy files in one file with filename using Batch

  19. 19

    Write a batch file to repeatedly copy files

  20. 20

    Copy files in one file with filename using Batch

  21. 21

    Batch find and copy files from a file list

  22. 22

    Copy files based on timestamp in a batch file

  23. 23

    batch file to copy files to specified folders

  24. 24

    batch file to copy files based on their names

  25. 25

    Batch File; List files in directory, only filenames?

  26. 26

    Batch File To Convert All Files In Directory To ATF

  27. 27

    Copy the file directory and files using Gulp

  28. 28

    Copy the file directory and files using Gulp

  29. 29

    batch file failed and cannot copy file from one directory to another

HotTag

Archive