I hope this helps you . I have created a batch file to copy one folders files to another folder. This code XCOPY C:\Temp\a.txt C:\Temp2\a.txt /Q works but when i run this file it ask Overwrite C:\Temp2\a.txt (Yes/No/All)? I want to do this without asking this question. How can i do ? And i want to this for aspx or aspx.cs files , From the manual:
This might help you I have two code bases of an application. I need to copy all the files in all the directories with .java from the newer code base, to the older (so I can commit it to svn). , XCOPY /D ?
xcopy c:\olddir\*.java c:\newdir /D /E /Q /Y
Using batch files to copy all files from a directory tree to a single directory
To fix the issue you can do Next time please give some kind of attempt, but, either way, a nested for loop should do the trick.
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
BATCH: How can I copy files to directory based on file name
this will help to some help from commenters, I was able to figure it out. I was having a problem with how to structure the script, but I got it!
for /f "delims=" %%i in ('dir /b /a-d *.7z') do (
REM CONDITIONAL STATEMENTS
IF !folder1! GEQ !firstdigit!000 IF !folder1! LEQ !firstdigit!249 SET "subfolder2=_!firstdigit!000-!firstdigit!249"
IF !folder1! GEQ !firstdigit!250 IF !folder1! LEQ !firstdigit!499 SET "subfolder2=_!firstdigit!250-!firstdigit!499"
IF !folder1! GEQ !firstdigit!500 IF !folder1! LEQ !firstdigit!749 SET "subfolder2=_!firstdigit!500-!firstdigit!749"
IF !folder1! GEQ !firstdigit!750 IF !folder1! LEQ !firstdigit!999 SET "subfolder2=_!firstdigit!750-!firstdigit!999"
mkdir "!parent!\!subfolder1!\!subfolder2!" 2>nul
copy "!filename!" "!parent!\!subfolder1!\!subfolder2!" >nul