[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

windows cmd question

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 2

File: Capture.png (6KB, 407x259px) Image search: [Google]
Capture.png
6KB, 407x259px
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
>>
>>61336000
for /r "SourceFolder" %i in (*.*) do copy "%~fi "TargetFolder"


I haven't tried this, but I would figure it would work.
>>
File: 1231231241.png (1MB, 1077x674px) Image search: [Google]
1231231241.png
1MB, 1077x674px
>>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
Thread posts: 10
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.