how can i move all files from one folder A to another folder B (which is empty)?
folder has many subfolders. files/subfolders from diferent folders can have same name.
i just want to copy files, not entire folder structure.
>>61336000
install gentoo
xcopy?
>>61336000
>how do i move all files
>i just want to copy files
first, make up your mind faggot.
second,man find
man cp
man mv
you fucking retard
>>61336068
nevermind, just saw in the title you were asking for winblows.
then kill yourself.
>>61336075
stupid linuxfag
>>61336000for /r "SourceFolder" %i in (*.*) do copy "%~fi "TargetFolder"
I haven't tried this, but I would figure it would work.
>>61336110
Forgot a double quote, this is what I meant:for /r "SourceFolder" %i in (*.*) do copy "%~fi" "TargetFolder"
>>61336110
>>61336141
i got this far, but files with same name are being overwritten
found the solution:@echo off
setlocal disableDelayedExpansion
:: Initialize and validate arguments
if "%~2" equ "" echo Error: Insufficient arguments>&2&exit /b 1
set "source=%~f1"
if not exist "%source%\" echo Error: Source folder "%source%" does not exist>&2&exit /b 1
set "target=%~f2"
if exist "%target%\" echo Error: Target folder "%target%" already exists>&2&exit /b 1
:: Do the work
md "%target%"
set /a n=0
for /r "%source%" %%F in (*) do if "%%~dpF" neq "%target%\" (
if exist "%target%\%%~nxF" (
set /a n+=1
set "full=%%F"
set "name=%%~nF"
set "ext=%%~xF"
setlocal enableDelayedExpansion
copy "!full!" "!target!\!name!_!n!!ext!" >nul
endlocal
) else copy "%%F" "%target%" >nul
)
script needs to be called with 2 arguments:
sourcePath and destinationPath