|
| |||||||||
| Tags: batch file, copy, delimiter, echo, move, windows xp, xcopy |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| Batch File to Move or Copy Files
__________________ "All gave some, some gave all." |
|
#2
| ||||
| ||||
| Re: Batch File to Move or Copy Files
You can try the following batch code to Move the files : @echo off for /F "delims=" %%i in (files.txt) do ( echo %%i move "%%i" c:\hello ) Space is a default delimiter. The delims parameter fixes that (here there are no default delimiters other than a newline). You'll also need double quotes around your variable name on the move line. Hope that you were looking for the same. |
|
#3
| ||||
| ||||
| Re: Batch File to Move or Copy Files
Try the batch command that I mentioned below which can be useful to copy the files : set path=c:\WINDOWS\system32; echo Copying started at %date% %time%>>_date_.txt xcopy E:\backup \\SERVER\BACKUP\others /s /a /d echo Copying finished at %date% %time%>>_date_.txt echo Completed Successfully at %date% %time%>>_date_.txt |
|
#4
| ||||
| ||||
| Re: Batch File to Move or Copy Files
I think that the Batch Code mentioned by the "Macarenas" should work. I have not tried to check that personally, but seeing that I guess it should work properly. If you are not able to then just use Xcopy directory [destination-directory] and then turn this into a .BAT file You can find the more information regarding your query at Batch file to copy a file from the local drive to a computer on lan?
__________________ Ram requirement for various OS |
|
#5
| ||||
| ||||
| Re: Batch File to Move or Copy Files
I have used the following script to copy file quickly from source to destination. This script can work on Windows XP, 2003 or the lower version. This script accept the two command line argument and the syntax for that is : mycopy.bat {source} {destination} Where, mycopy.bat is script that copies files and directories including subdirectories using Windows xcopy program. source is used to specify the location and names of the file/directory you want to copy. destination is used to specify the destination of the files you want to copy. |
|
#6
| ||||
| ||||
| Re: Batch File to Move or Copy Files
The source code of the mycopy.bat should be as follows : @rem BATCH FILE @echo off if "%1" == "" goto error1 if "%2" == "" goto error2 @rem * Copy from source to destination including subdirs and hidden @rem * File xcopy "%1" "%2" /S /E /H goto endofprogram :error1 echo You must provide source echo Syntax: echo %0 source destination goto endofprogram :error2 echo You must provide destination echo Syntax: echo %0 source destination goto endofprogram :endofprogram |
|
#7
| |||
| |||
| Re: Batch File to Move or Copy Files Quote:
Code: # Script MoveExe.txt
var str source, destination, list, file
lf -r -n -g "*.exe" $source > $list
while ($list <> "")
do
lex "1" $list > $file
system move ("\""+$file+"\"") ("\""+$destination+"\"")
done
Script is in biterscripting. Save the script in file "C:/Scripts/MoveExe.txt". To call the script, type this command into biterscripting GUI. Code: script "MoveExe.txt" source("C:/testfolder1") destination("C:/testfolder2")
Will move all .exe files from the source directory "C:/testfolder1" and its sub-folders (see the -r flag) to the destination folder of 'C:/testfolder2". |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Batch File to Move or Copy Files" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Create Batch file for laptops to copy templates | Hemal | Active Directory | 1 | 2 Weeks Ago 04:10 PM |
| Cannot delete/copy/move .MOV files | JoeT | Vista Help | 8 | 16-01-2010 10:35 PM |
| Can't Copy/Move Ext HD Files to iMac | Joe Michaels | Hardware Peripherals | 1 | 25-08-2009 11:11 AM |
| Batch file to copy a file from the local drive to a computer on lan? | dudelearn | Tips & Tweaks | 3 | 12-03-2009 12:56 PM |
| Do you want to move or copy files from this zone? | geircito | Windows Vista Network | 1 | 06-11-2006 10:21 PM |