Computer Hope
Microsoft => Microsoft DOS => Topic started by: w33man on October 05, 2007, 04:13:03 AM
-
Hi i'm new to batch file scripting and was wondering if anyone could help me
I'm looking to run a batch file that will replace one document with another
i.e. C:\temp\master.doc to C:\temp\minor.doc
I want to keep the master copy but replace the minor copy with an image of the master.
Any help greatly appreciated.
Or pointers to were I can see sample scripts /code etc
-
This sounds very simple, so I must have misjudged your requirement .. basically, you want to replace minor.doc with a copy of master.doc
Copy /Y C:\temp\master.doc C:\temp\minor.doc
the /Y means to answer yes to the 'do you want to overwrite' question
Graham
-
Tried that graham but although i am running this batch file locally and the files for testing purposes are local the dos prompt keeps telling me the files cannot be located
-
Hi graham found the problem running the batch file under c:\ Documents and Settings\localuser\temp\test1\filename.txt copying to c:\ Documents and Settings\localuser\temp\test2\filename.txt
doesn't like the spaces tried under C:\tempfile\ and it ran no problem cheers for your help mate
-
doesn't like the spaces
If the path is C:\Documents and Settings\user\file.txt,
You have to put " on each end.
"C:\Documents and Settings\user\file.txt"