Computing.Net > Forums > Programming > batch file to copy and move certain

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

Reply to Message Icon

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 .

Thanks,

Dan



Sponsored Link
Ads by Google

Response Number 1
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

Related Posts

See More



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
Reply:

I need to write a batch file to copy

C:\Program Files\Intuit\QuickBooks Premier

to

G:\

I know this has to be easy...call me dumb


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batch file to copy and move certain

Batch script to search/copy/replace www.computing.net/answers/programming/batch-script-to-searchcopyreplace/16663.html

Batch File to open and move .ttf fi www.computing.net/answers/programming/batch-file-to-open-and-move-ttf-fi/12043.html

Batch file to copy from network dri www.computing.net/answers/programming/batch-file-to-copy-from-network-dri/14488.html