Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
batch file to copy and move certain
Name: dharlett Date: August 15, 2004 at 13:16:13 Pacific OS: NT and win2000 CPU/Ram: pentium
Comment:
I am just learning to write .bat files.
I'm wanting to take all of the html files that start with "BWW" in my c:/freepour/html/ directory and copy them to the a: drive and then move them out of the c:/freepour/html/ directory into c:/freepour/html/backup/. That way, I'm only moving the files to the a: drive that were created that day.
Also, I want it to overwrite any data on the a: drive if necessary.
Is this going to be a difficult process or can someone help me .
Name: IVO Date: August 15, 2004 at 14:19:12 Pacific
Reply:
Here your script. The Del command erases all previous data onto the floppy. Otherwise if removed only the files with the same name will be overwritten.
@Echo Off Pause Insert in A: the floppy for html files Del A:\*.* /Q Copy C:\freepour\html\BWW*.htm A: If not errorlevel 0 (Echo Copy aborted & GoTo :EOF) Move C:/freepour/htmlBWW*.htm C:\reepour\tml\backup Echo Copy and backup completed
Please use the backslash to separate the directories not slash that is a Unix notation.
0
Response Number 2
Name: BasicDosHlp Date: August 15, 2004 at 18:00:23 Pacific
Reply:
Ivo That was interesting Can you tell me what the "/Q" Parameter Does? Just wondering
My Page has many quick explainations of basic commands Feel free to contribute Or enlighten me with code examples that are not on my page I am particularly interested in learning hardware periph
0
Response Number 3
Name: Candle Date: August 15, 2004 at 18:05:02 Pacific
Reply:
Q = Quick format
"Don't know what you don't know."
0
Response Number 4
Name: Mechanix2Go Date: August 15, 2004 at 19:46:02 Pacific
Reply:
Candle, /q quiet mode.
IVO, I think he needs to copy .html or .htm* or htm?
0
Response Number 5
Name: IVO Date: August 16, 2004 at 00:58:24 Pacific
Reply:
To BasicDosSHlp,
/Q means quite mode, not prompting to be confirmed. Actually Del A:\*.* /Q deletes the files stored in the root directory only; to propagate the erase process through the folders you have to set the /S switch, i.e.
Del A:\*.* /S /Q
and that works under Windows NT/2K/XP only.
0
Response Number 6
Name: dharlett Date: August 16, 2004 at 07:32:04 Pacific
Reply:
Thanks guys.
It works great.
Here's the final look at what I'm running:
@Echo Off Pause Insert in A: the floppy for html files Del A:\*.* /S /Q Copy C:\freepour\html\BWW*.html A: If not errorlevel 0 (Echo Copy aborted & GoTo :EOF) Move C:\freepour\html\BWW*.html C:\freepour\html\backup Echo Copy and backup completed
0
Response Number 7
Name: sparsons Date: September 8, 2004 at 21:15:37 Pacific
Summary: I did find a post similar to what I need, but need to find a way to prefix that script with the required local C drive search string and logfile update I need. Post I'm referencing is titled "batch fi...
Summary: I need a batch file to open folders in c:TempFonts and then move and delete any .ttf files therein to s:Projects\_fonts. I am a newbie to DOS batch files and any help will be greatly appreciated. Than...
Summary: I would like to create a batch file to copy from one network drive to another. \\Desktop\shareddocs\dir1\file1 to c:\douments and settings\all users\documents\file1. It is to overwrite/update the exis...