Over 1 million tech questions and answers.

Batch file to copy files

Q: Batch file to copy files

I know there are solutions for this on this forum but I can't get any of them to work in my specific situation.

I have a program that cannot deal with ZIP files and I need to manually sort them out. What I can do is export a partial location for these ZIP files to a txt files so I have:

filelist.txt:
folder\file.zip
folder\file2.zip
...
filder\fileN.zip

What I want to be able to do is create a batch file that will read the location of these files and copy them to a folder. The files are located on a network share but they r are mapped in My Computer. I can modify to the txt file so it gives the full path as a UNC path or a hard path.

I've been trying to get it to work using a For In Do statement but I don't know if that's the best solution. Help would be greatly appreciated. Thanks.

Dilo.

RELEVANCY SCORE 200
Preferred Solution: Batch file to copy files

I recommend downloading and running Reimage. It's a computer repair tool that has been proven to identify and fix many Windows problems with a high level of success.

I've used it in the past to identify and fix everything from blue screens (BSOD's), ActiveX errors, corrupt files and processes, dll/exe/sys errors, recover lost memory, Windows update problems, defragging, malware removal etc.

You can download it direct from this link http://downloadreimage.com/download.php. (This link will automatically start a download of Reimage that you can save to your computer.)

A: Batch file to copy files

If you need to replicate the folder structure you need to use xcopy or robocopy.
Posted via Mobile Device

Read other 2 answers
RELEVANCY SCORE 81.2

Hi all,

To increase our backup solutions, we have decided to backup our SQL database every hour to a folder within the C drive (we couldn't get it to backup straight to a USB drive). So now we need a way (batch file best solution?) to copy these files to the USB drive, lets say every 1.05hours just after they've been created?

Maybe we could copy the entire folder every hour and delete old backups that are in this folder and to the new place for the backups. (although I guess it won't work as it'll have the same folder name once it has been copied).

Or copy the individual files to that new folder although with this they have all different names so is it possible to copy the newest file to the new folder and then after this delete the old backups from a certain time frame?

Big thanks for your help!

A:Batch file to copy files from C drive to USB

Code:
REM Creates a Backup of files every hour
@echo off
:start
XCOPY <source path> <destination path> /w /f /-y
TIMEOUT /t 3600 /nobreak
goto start
This might work, I'm no expert by any means, but the batch file should copy all the files, and then pause for a hour, and then loop back to the start and complete the same process again.

Here's what the XCOPY switches mean - http://www.microsoft.com/resources/d....mspx?mfr=true

Read other 9 answers
RELEVANCY SCORE 80.4

I'm running vista on my computer and would like to be able to copy all log files containing the keyword "error" to a folder called "error logs"
thanks in advance
 

A:How to make a batch file to copy files containing a certain keyword

Welcome to the forum.

use the 'good old msdos' command find

Open command promt en type find /? this will help you see the syntax
 

Read other 1 answers
RELEVANCY SCORE 80.4

Hi all,

I need a batch file (code) to copy files from last month and zip it for archive. Can somebody help me please?

Thanks!
Samsunlu
 

A:batch file to copy files from last month to archive it.

Read other 8 answers
RELEVANCY SCORE 80.4

I want to write a batch file that do this for me:

- makes a directory with the "yy.mm.dd.hh.mm" as the directory name,
- copies files and folders from a TEST directory to above destination,
- copies only new (or modified) files from the TEST directory to a separate folder.

Any Idea?

A:a simple batch file for copy files and folders

To create a directory with the date and time as the name, In a batch file use:

set DirName=%date:~-4,4%.%date:~-7,2%.%date:~0,2%.%time:~0,2%.%time:~3,2%
MD \%DirName%

Then in the same batch file use robocopy to copy files to the new directory

robocopy TEST %DirName% /e

you need to add your own paths and read the robocopy help for the right switches you need.
By default Robocopy copies only files that don't exist in the target directory but because you are creating a new directory every time it will copy every thing in TEST

You could use the /A switch which only copies files with the Archive attribute set.

Read other 3 answers
RELEVANCY SCORE 79.6

I require a batch file or free utility that i can redistribute from my web site to other users, (gamers) that will copy the contents of a directory inside their game to a new location and re-name the directory at the same time. Something like this;

Copy "Genesis\Vehicles\truck\diesel\4tonbaker" to "Genesis\Vehicles\truck\diesel\4tonbutcher"

The batch file needs to be run without the need for a command line box being opened, that is, if the user can double click on it or run it with a 'right click' that would be great. Problem there is, I maybe need an exe file not a batch file. The other part of the problem is that the folder to be copied may or may not be in the same location on every PC that runs the file. It may be the case that the 4tonbaker folder is on;
C:\Genesis\Vehicles\truck\diesel\4tonbaker or
D:Genesis\Vehicles\truck\diesel\4tonbaker or even
E:\Games\mystuff\Genesis\Vehicles\truck\diesel\4tonbaker

and I require the end user to have no need to know, just for the directory to be copied and renamed when and where it is found.

If possible I then want the batch file to perform a second task. I want to distribute a folder, lets say it is 4tonbutcher and in that folder there are files lets say doc1.txt, doc2.txt and doc3.txt

On any given users PC 4tonbaker has these same named files but the content is different to the ones in my folder 4tonbutcher, I want to update the newly created folder, 4tonbutcher with the new txt files I d... Read more

A:Batch file or Exe to copy & rename directory and update files

Sounds like you need a windows shell program, I'm not expert enough to help you with this

Here's a nice tutorial:

Win32 Shell Scripting Tutorial

Off topic: this is trivial to do in UNIX, I can whip up a shell script for that in no time...

Read other 1 answers
RELEVANCY SCORE 78

I am a complete newbie when it comes to batch files and batch file software, so apologies in advance.

I've done some research on Google etc but I seem to just be getting more and more confused trying to use various different scripts and programs and reading different info on various websites.

This is what I need...

I have a folder with around 2000 files in it. I want to be able to copy certain files from this folder (normally around 40) and place them in a brand new folder, I want to be able to do this with nothing more than a txt file that has all the file names I need copying in it with every file name on a separate line.

I receive around 10 new txt files each day so you can imagine how tedious it is searching through 2000 files, picking out the 40 I need, 10 times a day everyday.

To make things even more complicated, the txt files I receive don't always have the correct file names in them, maybe there's a misspelling or a word or two missing for some of the names. That's ok when I'm going through picking out the files I need to copy myself because I can normally tell which file is being requested, but I can't see it being so easy for a program or whatever to do, I'm guessing it'll need to have a search feature where it picks out the most likely file.

I'd like it to be as automated as possible. I receive the txt file, make sure each file name is on a separate line then a program or script or whatever goes out and picks out the files (or most likely files f... Read more

A:search multiple files, copy+paste to new folder (batch file software?)

Contact Rent-A-Coder, Elance, or any of the other programming for hire sites. They could knock this out pretty quickly I would think.

Read other 5 answers
RELEVANCY SCORE 78

Hi,
I have a question  that how to copy file from remote desktop user drive to my local machine using  xcopy or any other protocol.

This is my server path "\\Trail01" and here is the file location "c:\Users\ashique.sheikh\Desktop\Day2.R"
How can i give this is in my batch file. I have used this
net use "\\Trail01" "[email protected]" "/USER:ashique.sheikh"
XCOPY /Y \\Trail01\c:\users\ashique.sheikh\Desktop\Day2.R  "D:\VMI"
But its not working. It is give path error.
How can i download this or is there any other way to do it?

Read other answers
RELEVANCY SCORE 72.4

Hello,

I need help to create an Excel macro that would

1. ask users to select x number of rows to be copied from one worksheet of one Excel file
2. once users have selected the rows to be copied, then the rows are copied from the one original Excel file into X number of target Excel files

Notes:
the target Excel files are all based on the same template
there is one worksheet in each of the target Excel files

in the target files, the rows should be copied from the first available empty row, going down

Looking forward to your help!

Thanks a lot.
Mzz
 

A:Macro needed to copy x number of rows from one Excel file into a batch of Excel files

Hi, welcome to the board.
Not much info there to get the correct picture.
Sample? Of source and template please
And not to forget, what version of Excel are you and the users using?
 

Read other 1 answers
RELEVANCY SCORE 68

Hi all,

Any idea how to write Batch File .bat to copy file from File Sharing & FTP Hosting to local directory.

Current the File Sharing & FTP Hosting is SMARTFILE.

I don't want to use WINSCP as the connector.

Thanks

A:Batch File .bat to copy file from File Sharing & FTP Hosting

Hi Chacha,

Give this batch file a try. All text in red, you should adjust before running.


Code:
@echo off
(
echo.Username
echo.Password
echo.lcd C:\Some\local\directory
echo.cd /Some/server/path
echo.binary
echo.get Some_file_to_download.txt
echo.bye
) > "%TEMP%\_%~n0.ftp"
ftp -s:"%TEMP%\_%~n0.ftp" "12.34.56.78"
del "%TEMP%\_%~n0.ftp"

Read other 1 answers
RELEVANCY SCORE 67.6

Hi Guys,

I want to make one batch file which daily copies yesterday's files from one folder & paste it to another folder.

I.e.
C:/111 folder has following files.
1.zip had yesterday's date
2.zip had yesterday's date
3.zip had last sunday's date

now, when i will run batch file today, it only copies 1.zip & 2.zip & move to another folder C:/222

So C:/222 contains following
1.zip had yesterday's date
2.zip had yesterday's date


Please note , i have to run this batch file daily which should not require any changes.

Read other answers
RELEVANCY SCORE 67.6

Hi all,

Please help!! I'm having a problem to copy some files from a folder.
My folder have lots of files and is there any way for me to write a batch file to copy only files according to "date modified"? For example last week files or yesterday files.

Please help!! Urgent!!!
Thank you.
 

A:Urgent!! Copy file by date modified using Batch File.

Take a look at XXCOPY: http://www.xxcopy.com/index.htm
 

Read other 2 answers
RELEVANCY SCORE 67.2

I am trying to copy files from a source directory to an output directory when the output directory already has a file with the following:
../reusable_components/<filename>#.

I already have the following:
findstr /s /i /m "\<../reusable_components\>" *.xml > results.txt
This will return a list of filenames with the text in it.

Now I want to parse the list of files and take out the filename after ../reusable_components. I tried:
for /f %%a in ('findstr /s /i /m "\<../reusable_components\>" *.xml') do (echo %%a)
but that didn't work any ideas?

Read other answers
RELEVANCY SCORE 67.2

Does anyone have a simple batch already made to copy? I need to copy everything from my Y:\ drive to my G:\drive. I need it to overwrite original files.. please.. if anyone has it... thanks.
 

A:Copy Batch file

This may work:

xcopy y:\*.* g:\ /a /e /k

Reference:
http://www.computerhope.com/xcopyhlp.htm
 

Read other 2 answers
RELEVANCY SCORE 67.2

Hi,
I am new to batch files and have read up a little on xcopy and robocopy. 
We currently have a folder which new builds are copied and compressed to .zip files and stuck in a  folder. Dozens of zip files are created every day
What I want to do is the following:

I want to copy the newest zip file from folder 1 to folder 2 and extract it. 

What is the simplest way to find and copy the newest zip file considering multiple zip files are created each day?

A:using a batch file i would like to copy the newest file to a new location.

Try this:
@echo off
for /F "delims=" %%a in ('dir  /b /od "d:\My Files\*.zip"') do set Youngest=%%a
xcopy /y "d:\My Files\%Youngest%" "Folder2\"

Read other 3 answers
RELEVANCY SCORE 66.4

I have Office 365. (Is my Outlook 365 or 2013 or ?)?

Anyway, I have figured out how to export .pst files for backup/safety purposes. Is there a way to download all the information from each email account into 1 big file. I think Office 2003 allowed for this. 2007 I don't think did. I am wondering if there is a way to do it in my current version of Outlook?

Outlook gets my Comcast email, my Gmail emails, and some from my own domain. I just want to get the information from all of them at once and be done.

Thanks for considering my question.
 

A:Batch copy all Outlook 365 .pst files

try looking here: http://www.howtogeek.com/tag/microsoft-office/#outlook

if i recall correctly, you can have as many emails as you want going into one outlook account, there is probably a limit, but you should be able to get three or four anyway. once your email is in your outlook, it will always be there until you delete it or archive it.

to make sure, send yourself an email into each one of your accounts, make sure it shows up in your outlook (it may take a few minutes). then archive it, delete the test ones, and restore the archive to see if they come back. once you are satisfied that it all archives, you're set.
 

Read other 1 answers
RELEVANCY SCORE 66.4

hi all.!!

Actually, I want to help my elder cousin brother this time. He has been given a task to create a new folder and copy about 1600 photographs from a folder that contains about 3700 photographs. He has a list of the file names that he need to copy in a separate *.txt file.

He can do it manually by opening the main photograph folder searching for the filename and then copying that to a separate folder. But that would take a lot of time and efforts. I was wondering there must be a better way to do it.

It would be better if a command could copy the file name from the Text file, searches for it in the main photograph folder and when it founds the file matching the name then copies that file to a separate folder.

Is there any cmd command (Windows 10) or a Linux Bash command to do the job instead of doing it manually. If anyone knows a better way to do this then please do mention it as it will save a lot of time and efforts.

Thanks in advance.

Please excuse my English, as it is not my first language, I guess I was able to explain the problem. However, if any more detail is needed please do let me know.
 

Read other answers
RELEVANCY SCORE 66.4

What is the command to copy a file from a ThinApp location?
example:
copy "C:\Documents and Settings\all users\Start Menu\PortableApp\Thinstall\Application\%StartMenu%\PortableApps\Register.mny" "Y:\PortableApps\file"
This example does not work, I guess it is because of \%StartMenu%\. Any suggestions

Thanks,

jjblack
 

A:batch file copy command

Read other 8 answers
RELEVANCY SCORE 66.4

Fellow Forum Members,
I have two external hard drives I'm calling Hard Drive A and Hard Drive B. Hard Drive A & B are mounted to external USB cradles. Both USB cradles are connected to the same PC containing Hard Drive C. My objective is to transfer all data files, folders, sub folders from both Hard Drive A & B over to two different hard drives on Hard Drive C.

I need help figuring out Windows 7 so I can accomplish the task above. I have heard of RoboCopy but don't know how to write the script. Does an application such as XYExplorer perform the task of batch copying from multiple external hard drives over to two different folders in an internal hard drive?

How would a RobyCopy Script look like that does the following:

Copy G:\hdA_data1 over to C:\data1_from_hdA
Copy H:\hdB_data2 over to C:\data2_from_hdB
Automatically Turn off computer after copy operation is done


Any info will be greatly appreciated. Thanks in advance.

A:Windows7 Batch File Copy Possible?

Hi,

I haven't had much luck with working out how to turn the computer off automatically, although it can be done.

For the copy process, just usex copy, robocopy gives no benefit since this is a one time? copy of files.


Code:
xcopy G:\*.* /E C:\DataG
xcopy H:\*.* /E C:\DataH
From the cmd prompt:

Code:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Colin>xcopy /?
Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
[/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
[/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B]
[/EXCLUDE:file1[+file2][+file3]...]

source Specifies the file(s) to copy.
destination Specifies the location and/or name of new files.
/A Copies only files with the archive attribute set,
doesn't change the attribute.
/M Copies only files with the archive attribute set,
turns off the archive attribute.
/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.
/EXCLUDE:file1[+file2][+file3]...
Specifies a list of files containing strings. Each string
should be in a separate line in the files. When any of the
strings ... Read more

Read other 2 answers
RELEVANCY SCORE 66.4

Is there a simple way to copy an entire folder and its subfolders to another location using a batch file?

Thanks,
Harold
 

A:Batch file to copy subfolders?

Read other 8 answers
RELEVANCY SCORE 66.4

hello every onei am just started to learn about batch files, and done some really basic ones So i was just trying out the copy command just to try one for myself, but seem to be getting stuck"EXAMPLE" I WAS TRYING TO COPY C:\TEMP TO C:\Documents and Settings\ROWLEY.PRIVATE-3264A01\My Documents I also tryed copy c:\temp to c:\my documents. but as i am new to this i am doing something wrong can anyone shed any light on this for me. i am using windows xp. Copies one or more files to another location.COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination] [/A | /B]] [/V] [/Y | /-Y]source Specifies the file or files to be copied. /A Indicates an ASCII text file. /B Indicates a binary file. destination Specifies the directory and/or filename for the new file(s). /V Verifies that new files are written correctly. /Y Suppresses prompting to confirm you want to overwrite an existing destination file. /-Y Causes prompting to confirm you want to overwrite an existing destination file. The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line.To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format).Examplescopy *.* a:Copy all files in the current directory to the floppy disk drive.copy autoexec.bat c:\windowsCopy the autoexec.bat, usually found at root, and copy it into the windows director... Read more

A:Batch File Copy Command

The copy command works on files, not on directories. So, for example, if you wanted to copy all the files in the Temp directory (NOT A GOOD IDEA, BTW - it'll copy a whole bunch of nonsense stuff) to your My Documents folder the syntax would be:

COPY C:\TEMP\*.* TO C:\Documents and Settings\ROWLEY.PRIVATE-3264A01\My Documents\*.*

This will copy everything in the C:\Temp directory to the My Documents directory that's indicated here. The use of the wildcards of *.* means that it will copy everything with entries before the . and everything after the .

It'd be a better experiment (IMO) to just copy 1 text file from the Temp directory to the My Documents directory. In this case it'd be:

COPY C:\TEMP\filename.txt TO C:\Documents and Settings\ROWLEY.PRIVATE-3264A01\My Documents\*.*

You'll end up with a document named filename.txt (if it exists in your Temp directory) in your My Documents folder.

Just for experimentation, try typing "dir *." (without the quotes) at the command prompt. It'll give you a listing of the directories that are located within the folder that your command prompt is open to.

Read other 2 answers
RELEVANCY SCORE 66

Help me make a batch file that copies a file from one computer to another computer in a network...

PC1 = Source
PC2 = Destination

I want to copy a file from PC1's Drive E: to PC2's Drive E:

A:How to copy a file from 1 pc to another pc in network using batch file

Yes I want to copy files from PC1 to PC2 over the network...

PC1's Drive E:\Online Games\Battle of Immortals\Battle of the Immortals
to
PC2's Drive E:\Online Games\Battle of Immortals\Battle of the Immortals

Read other 9 answers
RELEVANCY SCORE 66

Hi ,

I am very new to windows.

I wanted to know how to copy the files from Linux to Windows using script ? Not all the files but only selected file pattern.

Like I want to copy all the files with today's date ( abc02152013abcd , xyz02152013mno ..) from Linux Machine A under the path /usr/tmp to windows machine path Z:test/

Any help in this regards ?
 

Read other answers
RELEVANCY SCORE 65.6

How do I make a batch file that will periodically copy a HTML file from the internet to my computer. The file is open access and does not need a password.
 

A:Batch file to copy HTML from internet

Tiradientes,

Try this:

http://www.chami.com/tips/windows/062598W.html
 

Read other 2 answers
RELEVANCY SCORE 65.6

Hello Everyone its me again, I need help on this new file I was making to Add and Delete Mods for Garrys Mod by the few clicks of some buttons.
But I've ran into a problem.

(Im not going to give the whole code because its way to long I'll give shortened version of it.)

Heres what I had before:

IF Not exist "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_charge\init.lua" copy "C:\Users\~\Desktop\Ultimate Gmod Folder\Mods\shoop_da_whoop\Shoop da Whoop\lua\effects\stridcan_charge\init.lua" "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_charge\"
IF Not exist "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_expld\init.lua" copy "C:\Users\~\Desktop\Ultimate Gmod Folder\Mods\shoop_da_whoop\Shoop da Whoop\lua\effects\stridcan_expld\init.lua" "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_expld\"
IF Not exist "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_fire\init.lua" copy "C:\Users\~\Desktop\Ultimate Gmod Folder\Mods\shoop_da_whoop\Shoop da Whoop\lua\effects\stridcan_fire\init.lua" "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_fire\"
IF Not exist "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_mzzlflash\init.lua" copy... Read more

A:Solved: Gmod Batch File Copy Help???

Read other 11 answers
RELEVANCY SCORE 65.6

Below is a batch file I created to copy all the files from a program called A5V5. This batch file works to copy the files to two different drives What I want to do is if the J: Directory is not availble (This is a flash drive) that it will copy to the E:\ directory which is a second HDD and not leave a "The system cannot find the drive specified" when the flash drive is not inserted.

@echo off
cd c:\
cd program files (x86)
cd A5V5
cd Ranch Mobile, Inc
Copy *.* "E:\Ranch Mobile" (This is a second hard drive for backup files only)
Copy *.* "J:\Ranch Mobile" (This is a Flash drive that is not always inserted)
Pause

Thanks for any help. I like the way batch files work and I can do these simple ones but when it comes to doing the more complicated ones I am at a total loss.

A:How to make a multible copy batch file

Hi AGB,

Welcome to Seven Forums.

Can you try the following and see if this works:

Code:
@echo off
cd "c:\program files (x86)\A5V5\Ranch Mobile, Inc"

Copy *.* "E:\Ranch Mobile"

IF EXIST J:\ (goto jdrive) ELSE (goto end)

:jdrive
Copy *.* "J:\Ranch Mobile"

:end
Pause
This will always copy to your fixed E:\ drive and will only copy to your J:\ drive when exists.
Is this what you wanted?

Regards,
JDobbsy1987

Read other 3 answers
RELEVANCY SCORE 65.6

Hi
I am currently running the following to supposedely create a directory IE V:\Backup Folder\Pictures\Backup 21-05-2012
robocopy /e "c:\users\jon\pictures" "v:\Backup Folder\Pictures\Backup %date:~-10,2%-%date:~-7,2%-%date:~-4,4%"

Evrything works fine except the backed up pictures folder is just named as V:\Backup Folder\Pictures\My Pictures

If for arguments sake I backup my outlook file using the above parameters I get what I want EG
V:\Backup Folder\Outlook\Backup 21-05-2012

It's as though there is something within the pictures folder? that is preventing the corrctly named folder from beign created?
The same happens when I try and backup Desktop and Documents folders
What am I missing?

A:Creating Batch File with Robo Copy

  
Quote: Originally Posted by Big Tung


Evrything works fine except the backed up pictures folder is just named as V:\Backup Folder\Pictures\My Pictures


Hi,

I can't quite understand where the \My Pictures is coming from. Do you mind posting a screen capture image of the folder arrangement, so I can see what it looks like?

regards,
Golden

Read other 3 answers
RELEVANCY SCORE 65.6

Lately I've noticed a lot of new Windows users don't really know how powerful command line tools Windows 7 includes.

Here's one, making batch file copy easy and almost automated: Robocopy. To use it, just open the command prompt and type robocopy /? to get all the options. Here's the summary in case you are interested:

-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Usage :: ROBOCOPY source destination [file [file]...] [options]

source :: Source Directory (drive:\path or \\server\share\path).
destination :: Destination Dir (drive:\path or \\server\share\path).
file :: File(s) to copy (names/wildcards: default is "*.*").

::
:: Copy options :
::
/S :: copy Subdirectories, but not empty ones.
/E :: copy subdirectories, including Empty ones.
/LEV:n :: only copy the top n LEVels of the source directory tree.

/Z :: copy files in restartable mode.
/B :: copy files in Backup mode.
/ZB :: use restartable mode; if access denied use Backup mode.
/EFSRAW :: copy all encrypted files in EFS RAW mode.

/COPY:copyflag[s] :: what to COPY for files (default is /COPY:DAT).
(copyflags : D=Data, A=Attribut... Read more

A:Batch file copy made easy

I've been using robocopy for years. It does pretty much all of my backups at home and my laptop backup at work. Most things backup to an external hard drive (or a couple as I like to keep one offsite)

C:\Windows\system32\robocopy C:\users\user1\Documents E:\Backups\PC-name\Documents /MIR /E

That commands mirrors up the source and destination and gets empty folders thus preserving the directory structure.

Robocopy only copies files that have changed...thus subsequent copies are extremely fast.

I highly recommend it.

Read other 3 answers
RELEVANCY SCORE 65.6

I have a folder on a network drive that I would like to copy to another location on another network drive. The source folder should copy over the destination folder, part of the path to the destination folder to be copied over changes based on the person who signs into the PC; OS is XP. This is what I thought would work but hasn?t. Any help would be much appreciated.

XCOPY ?\\Server Name\ Folder1\Folder to be copied? ?\\Server Name\%userprofile%\Folder\my documents\Same Folder Name As in The source folder to be copied over" /E /C /R /I /K /Y

A:Copy Folder batch File Issue

XCOPY ?\\Server Name\Folder1\SourceFolder? ?\\Server Name\%username%\Folder\my documents\DestinationFolder" /E /C /R /I /K /Y

Hope this helps

Read other 1 answers
RELEVANCY SCORE 65.6

I'm trying to create a batch file that will copy from a source and paste into a destination. I need it to add the date and time to the file name as well.

So far, I have it successfully adding the date with the following code:

ren <file> <file>%date:~4,2%-%date:~7,2%-date:~10%.doc

This works....but I cannot seem to add the time as well.
Any help?

 

A:Simple Copy and Paste Batch File

See if this thread helps?

Or, just copy the files and use a utility like Rename to do the file name changes after the fact.
 

Read other 1 answers
RELEVANCY SCORE 64.8

Hi,
I have a few questions about my simple batch to copy a Outlook pst file to an external drive. First, robocopy doesn't copy my file; Second, is there a way to prevent the taskeng.exe window from appearing; and Finally, I tried the command "copy" instead and it copies the file but the taskeng.exe window "hangs" and does not continue to restart outlook and therefore close on its own. By the way, the pst file is over 4Gb. Any help is appreciated, thank you!

:: Backup pst file to Server external drive
@echo off
setlocal EnableDelayedExpansion
start "" "C:\Program Files (x86)\Microsoft Office\Office12\Outlook.exe"
taskkill /im outlook.exe /f
@ping 192.168.1.1 -n 5 -w 1000>nul
@ping 192.168.1.1 -n 5 -w 1000>nul
robocopy "C:\Users.pst" "\\SERVER\Outlook Backup\user.pst"
start outlook.exe
cls
@exit
 

A:Batch to copy Outlook pst file to external drive

Read other 6 answers
RELEVANCY SCORE 64.8

I am trying to write a batch file that will copy my backup files to another drive. For example I currently have the file backed up to C:\Backup\movie backup
I want to be able to copy it to an external HDD: -
X:\Backup Folder\Movie Library, however each time I do this it overwrites the previous backup file.
I want to be able to copy this backup to a new folder each and every time, as follows: -
Todayís backup file would copy to:-
X:\Backup Folder\Movie Library\backup 03-Jul-2010 .......tomorrows would go to
X:\Backup Folder\Movie Library\backup 04-Jul-2010 etc
Can anyone help. I have been looking all day and can't find anything.

Thanx in advance

Jon
 

A:Batch File to copy to Date Stamped Folder

Welcome to TSG!

Use "X:\Backup Folder\Movie Library\backup%date%" as the destination folder name in your batch file. The %date% variable will be expanded with today's date
 

Read other 2 answers
RELEVANCY SCORE 64.8

I need help with a batch file to copy the contents of my source dir to the destination dir that is to be created with that days date using xcopy or robocopy. Any help is appreciated!

A:Need a Batch File to Copy to a Custom Dest Folder

This should get you started...

for /F "tokens=1-4 delims=/- " %%A in ('date/T') do set DATE=%%A-%%B-%%C
md c:\tmp\%DATE%
xcopy c:\output c:\tmp\%DATE% /s

Read other 4 answers
RELEVANCY SCORE 64.8

I have a usb that I copy files from to new computers. I do this all day and would like to make it quicker.
I will have an XP path and a Vista/7 path, but just worried about XP right now.
The problem is I don't know what drive letter the USB will be in. I thought there was a %thisdrive% switch of some time.

In addition it has spaces and I don't know how to replace spaces in the path. Here is an example;

copy f:\install\105 wallpaper\*.* c:\documents and settings\All users\Shared Docuemnts\Shared Pictures\

Summary;
Determine the USB drive letter?
bridge space issue?
 

A:batch file to copy from usb- unknown drive letter

Read other 8 answers
RELEVANCY SCORE 64.4

I'm trying to write a .bat that's supposed to handle the very simple task of copying a file to the desktop.

Something like:

copy x:\folder\file.ext [desktop]\file_backup.ext

The problem: [desktop].

It would be really easy if I could simply insert %desktop% the same way as %windir% etc. Unfortunately, %desktop% doesn't exist.

Using the variable for userprofile doesn't work either, because the user may have moved the desktop folder out of the docs & sets folder to any other location, and not necessarily on the same partition or drive.

It would be easy in a .vbs, but that won't work if the windows script host is locked down or disabled.

So it has to be a batch file. Does anyone know how to explain a .bat how to find the desktop?
 

A:Batch file: how to insert desktop location into copy command

Read other 16 answers
RELEVANCY SCORE 64.4

I have a list of 1000 files names that I put in a text file named list.txt. Need to find them in more folders, sub folders which has 12000+ files in it. The below script works fine but I would like the Admin Right to be removed and also I want the files to be moved permanently into C:\your_files. Is there any one who could help me in this? Thank you in advance.

@echo off
REM (c) 2013 BY NEUTRON16 (http://www.sevenforums.com/member.php?u=3585)
CLS
TITLE Mass file finder by Neutron16
REM finds files in list.txt file and copies them to C:\your_files
REM CHECK FOR ADMIN RIGHTS
COPY /b/y NUL %WINDIR%\06CF2EB6-94E6-4a60-91D8-AB945AE8CF38 >NUL 2>&1
IF ERRORLEVEL 1 GOTO:NONADMIN
DEL %WINDIR%\06CF2EB6-94E6-4a60-91D8-AB945AE8CF38 >NUL 2>&1
:ADMIN
REM GOT ADMIN RIGHTS
COLOR 1F
ECHO Hi, %USERNAME%!
ECHO Please wait...
FOR /R "%~dp0" %%I IN (.) DO for /f "usebackq delims=" %%a in ("%~dp0list.txt") do echo d |xcopy "%%I\%%a" "C:\your_files" /e /i
COLOR 2F
ECHO.
ECHO (c) 2013 by Neutron16 (http://www.sevenforums.com/member.php?u=3585)
PAUSE
GOTO:EOF
:NONADMIN
REM NO ADMIN RIGHTS
COLOR 4F
ECHO.
ECHO PLEASE RUN AS ADMINISTRATOR
ECHO.
pause
GOTO:EOF

Read other answers
RELEVANCY SCORE 62.8

I would like to copy all pdf files from  directory 'src' and sub-directories 'src/src-sub1' to directory 'trgt', including the directory structure. Any suggestion? thanks!

A:windows batch script to recursively copy file/directory of a specific patern

Hi,
I have to use windows batch script and buildin commands. Any suggestion is welcome. Thanks!
Both are available in batch:
Robocopy: http://ss64.com/nt/robocopy.html
XCopy: http://ss64.com/nt/xcopy.html
Don't retire TechNet! -

(Don't give up yet - 12,700+ strong and growing)

Read other 9 answers
RELEVANCY SCORE 61.6

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...

A:How to create a batch file that will move files based on the file type

Download XXCopy
XXCOPY, A Versatile File Management Utility --- Boldly Extended Xcopy
This is a vastly improved and extended version of DOS XCopy
Sorry, can't remember the syntax, but its quite simple if you read the manuel carefully :-)
Put the command line in a .bat file and it will run

Read other 4 answers
RELEVANCY SCORE 61.6

Hello all , i am new to batch programming.

I wish to have a batch file to read .apk file from folder and then copy it to another folder. Then it should rename the copied apk file to test.apk

eg:
i have a file in folder e:\apps\angrybirds.apk , I want to copy this angrybirds.apk to d:\apps and rename it to test.apk

Here the file names in the e:\apps\ will be changing. So what ever may be the name , it should read the name of the file from e:\apps\ folder , copy it to d:\apps\ and rename it to "test.apk" . Test.apk is a fixed rename
 

A:Solved: Batch file to copy a file from folder and rename it in another folder

Read other 12 answers
RELEVANCY SCORE 60.8

I am wondering how to write a script that would delete all files of a certain extension from a folder.
 

A:Solved: Batch file to delete all .xxx files from a file

Read other 6 answers
RELEVANCY SCORE 60

Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can...

First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg.

Here's the code that I'm using:

ffmpeg -i folder\video.mp4 -f mp3 -ab 160000 -vn "\different folder\music.mp3"

what I would like to do is add to this so that I don't have to write out this code for every file I have... :/

I have the mp4 files in one folder and than the mp3 files are saving to another folder.

So here's an example of what the code will do if it isn't clear yet.

Folder 1:

video1.mp4
video2.mp4
video3.mp4

what it should do is grab video1.mp4 and convert it.

ffmpeg -i folder\video1.mp4 -f mp3 -ab 160000 -vn "\different folder\music1.mp3"

and than move onto the next one

ffmpeg -i folder\video2.mp4 -f mp3 -ab 160000 -vn "\different folder\music2.mp3"

and than the next one

ffmpeg -i folder\video3.mp4 -f mp3 -ab 160000 -vn "\different folder\music3.mp3"

It's going to have to grab the name from the mp4 file and insert it for the mp3 file.

I can get around pretty good in cmd if it's basic commands but when it comes to something like this I'm a little confused...

Thanks for the help in advance!
I'll see what i can do about searching some more on what I would have to do and if I find the solution I'll post it here if it isn't already answered.

A:Batch File that grabs file names from folder to insert into batch file

A DOS "for /f" loop should do the trick, although changing the filename extension for the output to do everything in one line escapes me at the moment.

Perhaps you could do a dir .\folder\*.mp4/s/b > mp4s.txt, then make a copy of that and edit each line to rename the file to the destination name, and save it as mp3s.txt. Then you just feed both the source (mp4s.txt) and destination (mp3s.txt) filesnames into the for /f loop which handles the ffmpeg conversion.

Quite a crude solution and you'd have to handpatch the destination filenames, but i can't think of how to get a source mp4 filename and then just change the extension.

Read other 3 answers
RELEVANCY SCORE 59.2

Hi all,
I have the following batch file :

@echo off
for %%a in (*.xml) do (
findstr /c:"<national-code>Y03051</national-code>" "%%a" >nul && move "%%a" "d:\david\result\"
)

this moves the files nicely however what if i wanted to supply the Y03051 myself. e.g. I run the batch file, it should ask me for the code, in the example Y03051, which I would input, press enter it should then move all those files containing Y03051?

I have done it in the past but I cant remember how to do it.

Also how easy is it to move this script to powershell

Read other answers
RELEVANCY SCORE 59.2

Hi Guys,

Im trying to copy a file from one folder to another but the batch file is not working, it says incorrect syntax. the command line im using is:

COPY C:\TEST *.* C:\BACKDIR

Does anyone know why this isnt working?

Thanks
 

A:Copying files using a batch file?

Ok, ive manage to get it working and it copies the file across using:

C:
XCOPY C:\test C:\backdir

But what i want to do is copy the personal folder in outlook to this file. So when i change it to:

C:
XCOPY C:\Documents and settings\[username]\...........\outllook C:\backdir

Its failing again with the error "Invalid number of parameters"?
 

Read other 2 answers
RELEVANCY SCORE 59.2

Hi. I want optimize my jobs and I write some batch file.
So I need to batch file do:
Open and edit C:/windows/system32/ "AUTOEXEC.NT" and "CONFIG.NT"
Just need add some lines at end of file and edit few lines at file. Is that possible? Can anyone give me some script example?

A:Batch file: need edit files.

A batch file is in the format .bat. And you can edit them simply by opening them up in Notepad.

Read other 8 answers
RELEVANCY SCORE 58.4

Iím very much a novice when it comes to batch files.
Any help at all to point me down a path to solving this would be much appreciated.

The Problem 1:
I have around 15k CAD files i need to check the extension and rename to DGN.
Someway of have the batch file checks all the sub folders of the main CAD file and change and files that do not have the proper extension to DGN.

The file system is as follows:
L:\Michael\Organized Updated Drawings\32\CAD\A\32-A-009.DGN
The main structure is the bold section.

I have a directory legend with all the numbers and letters used in the file system.
You first have the number area the drawing is in and then if itís a cad file, next are the letter(s) which determines what discipline it is (water, electric, etc).
The Problem 2:
I also have an additional 10k CAD files that where mass imported in a single folder to sort through.

Each file has varying extensions that denote what area the file belongs to in the paper mill I work for.

The old system would save them as such.
5232168419.70K
5213541516.30I
5516684651.80S

I need to change the extension of each file to DGN.
Like this:
5232168419.DGN
5213541516.DGN
5516684651.DGN

I did figure out how to create a list.txt of the files and pull that into excel.
I was using ="ren "&A1&" "&D1 to rename the extensions all to DGN.

I think i would be better to if i can place them in sub folders based on there original extension.

Such as if the file is like this one.... Read more

A:Using a batch file to find and rename files.

Read other 6 answers
RELEVANCY SCORE 58.4

Hi All,

I am trying to write a batch file that will rename all the files in a folder with a date and time stamp at the end of the file. For example if the file name is

123456.txt

I want to rename that to

123456_20100624.txt

This is what I got so far.
Code:

For /F "tokens=1-3,5-8 delims=/:. " %%a in ("%TIME% %DATE%") do (set _dt=%%g%%e%%f%%d-%%a%%b%%c)

PushD C:\test
FOR /f %%a in ('dir /A-D /on /B "*.*"') DO (rename "%%a" "%_dt%.txt")
PoPD

I am trying to do a directory listing and then to rename them. But I don't know how to hold the name of the file and the date at the same time to be added to the filename. Any help is appreciated!!. thanks!
 

A:Batch File rename multiple files

Read other 7 answers