Batch file to copy files from one directory to another
Date : March 29 2020, 07:55 AM
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
Date : March 29 2020, 07:55 AM
it helps some times I needed to copy all the files from a directory tree into a single directory. A quick search provided me with this method: @echo off
set "COPY_FROM=C:\Users\me\Desktop\Disc 1"
set "COPY_TO=C:\Testing\test"
md "%copy_to%" 2>nul
cd /d "%COPY_FROM%"
for /f "delims=" %%a in ('dir /b /s /a-d') do copy "%%a" "%COPY_TO%"
pause
|
Copy files from Ftp to local directory using batch file
Date : March 29 2020, 07:55 AM
this one helps. When connecting to a server via the built-in FTP client you have to skip ftp://! So open ftp.prodega.ch will fix your issue.
|
Batch file to copy 3 files to new directory
Tag : shell , By : kdietz
Date : March 29 2020, 07:55 AM
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. @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
)
)
|
BATCH: How can I copy files to directory based on file name
Date : March 29 2020, 07:55 AM
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! @echo off
for /f "delims=" %%i in ('dir /b /a-d *.7z') do (
set "filename=%%~i"
setlocal enabledelayedexpansion
set "folder1=!filename:~0,4!"
set "subfolder1=_!folder1:~0,1!000-!folder1:~0,1!999"
set "firstdigit=!filename:~0,1!"
set "parent=\\nas01\The_Archives"
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
)
|