New
#1
Mass Move Batch file
Hey All, I have a list of files that I need to move (cut and paste) from location to another location.
Thanks in advance
Hey All, I have a list of files that I need to move (cut and paste) from location to another location.
Thanks in advance
Hi, can you describe a bit more about what you need?
By the sounds of what you've said, you have a text file containing a list of files to move?
Exactly JonM, i have a list of over than 3000 records and i want some of them (which already in list.txt) to be moved to another directory. (Cut and paste)
Here you are, Migooz. Just tweaked the batch script made in your previous thread.
Code::: th-378655.bat [TxtFileList] [DestinationPath] @echo off REM Move files/folders specified in a newline-delimited txtfile list to the location of 'DestinationPath'. set "default_list_path=C:\Users\%USERNAME%\Desktop\ListOfFilesToMove.txt" set "default_destination_path=C:\Entries\in\ListOfFilesToMove.txt\will\be\moved\to\here" set "overwrite=FALSE" if not "%~3"=="" echo Error: unexpected arguments& exit /b if not "%~2"=="" ( set "destination=%2" ) else ( set "destination="%DEFAULT_DESTINATION_PATH:"=%"" ) if not "%~1"=="" ( set "list=%1" ) else ( set "list=%DEFAULT_LIST_PATH%" ) if not exist "%LIST:"=%" echo Error: list could not be found& exit /b if not exist "%DESTINATION:"=%" echo Error: the destination path could not be found& exit /b set /a counter=0 for /f "delims=" %%I in ('type "%LIST:"=%"') do ( if exist "%%~fI" ( if exist "%DESTINATION:"=%\%%~nxI" ( if /i "%OVERWRITE%"=="TRUE" ( set /a counter+=1 move /y "%%~fI" "%DESTINATION:"=%" >NUL ) else ( echo The path "%DESTINATION:"=%\%%~nxI" already exists. ) ) else ( set /a counter+=1 move "%%~fI" "%DESTINATION:"=%" >NUL ) ) else ( echo No such item "%%~I". ) ) echo.& echo %COUNTER% files or folders were moved.
thanks Pyprohly for your great support, but i cant move them to other directory other than C: is there something wrong
Last edited by migooz; 22 Aug 2015 at 11:04. Reason: in complete solution
Could you elaborate on the issue? The script moves files to other drives well for me.