Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: re-advertised need help Pllllleaaaaaasse  (Read 2207 times)

0 Members and 1 Guest are viewing this topic.

w33man

  • Guest
re-advertised need help Pllllleaaaaaasse
« 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

gpl



    Apprentice
  • Thanked: 27
    Re: re-advertised need help Pllllleaaaaaasse
    « Reply #1 on: October 05, 2007, 05:38:38 AM »
    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

    w33man

    • Guest
    Re: re-advertised need help Pllllleaaaaaasse
    « Reply #2 on: October 05, 2007, 07:36:37 AM »
    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

    w33man

    • Guest
    Re: re-advertised need help Pllllleaaaaaasse
    « Reply #3 on: October 05, 2007, 08:10:06 AM »
    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

    Carbon Dudeoxide

    • Global Moderator

    • Mastermind
    • Thanked: 169
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Experience: Guru
    • OS: Mac OS
    Re: re-advertised need help Pllllleaaaaaasse
    « Reply #4 on: October 06, 2007, 05:53:03 AM »
    Quote
    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"