Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Mass Move Batch file

16 Aug 2015   #1
migooz

Windows 7 Ultimate x64
 
 
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


My System SpecsSystem Spec
.
16 Aug 2015   #2
JonM

Windows 7 Professional x64, RHEL 5,6,7
 
 

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?
My System SpecsSystem Spec
17 Aug 2015   #3
migooz

Windows 7 Ultimate x64
 
 

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)
My System SpecsSystem Spec
.

17 Aug 2015   #4
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

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.
My System SpecsSystem Spec
22 Aug 2015   #5
migooz

Windows 7 Ultimate x64
 
 
thanks Pyprohly

thanks Pyprohly for your great support, but i cant move them to other directory other than C: is there something wrong
My System SpecsSystem Spec
23 Aug 2015   #6
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

Could you elaborate on the issue? The script moves files to other drives well for me.
My System SpecsSystem Spec
Reply

 Mass Move Batch file




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Batch File to Move a list of files.
Hey All, I just joined this forum to find some help on a specific topic that I've been researching for like two hours now on google. I have a list of 1300 files that I need to move from one location to another (move not copy). I've found this batch file created by Neutron16 which performs a Move...
General Discussion
[Help] Batch File move every 15.000 files to another folders
Hi guys I'm new here, please help I have about 2 million email files that i want to convert into mbox files. but the tool i used only can convert every 15.000 files. so i need a batch file that can move this 2 million files into another folder (15.000 files each folder) and the folder name...
General Discussion
Can I mass apply RAA using a batch file or other quick trick?
I was wondering if there was a way to easily apply RAA to multiple (read 50+) .exe files on a system. We put systems out that require multiple exe files to have this setup and it takes time to go through and click each one. Could it be done by doing a registry batch file? Or AutoIT or other...
Software
Batch file to move desktop icons so ALL are sorted.
Win7 stores desktop icons in two different folders: C:\Users\Public\Public Desktop C:\Users\UserName\Desktop This results in two groups of sorted icons on the desktop. I want to move all of the icons in the "C:\Users\Public\Public Desktop" to the "C:\Users\UserName\Desktop". This will...
General Discussion
Batch file to move (many) duplicted folder contents - Help!!
Hope I can explain my difficulty. I have duplicated folders album name for all my music files. As there is quite a considerable number I wondered if it was possible to batch file (automate) the process. I can not delete "d" as this would delete all the tracks. What I need to do is move the...
General Discussion
How to create a batch file that will move files based on the file type
How to create a batch file that will move files based on the file type? My Requirement : I need a batch file to copy all .doc files in all my HardDisk to a removable disk say (Z: drive) . Can anyone make it possible using a batch file?Please...Its urgent...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 09:44.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App