xcopy command

aueddonlineaueddonline Member Posts: 611 ■■□□□□□□□□
hey guys i'm trying to make a batch file that copies files from one folder to another but converts all the files to .txt from a .doc format while they are being copied.

is this possible using a batch file i've had a look at the xcopy command which is doing the main bit just need a parameter that is going to convert these suckers
What's another word for Thesaurus?

Comments

  • undomielundomiel Member Posts: 2,818
    copy %1*.doc %2*.txt
    Jumping on the IT blogging band wagon -- http://www.jefferyland.com/
  • aueddonlineaueddonline Member Posts: 611 ■■□□□□□□□□
    would it look anything like this

    copy C:\vpn-folder M:\ubuntu-xps-files %1*.doc %2*.txt
    What's another word for Thesaurus?
  • undomielundomiel Member Posts: 2,818
    Your batch file would be:

    copy %1*.doc %2*.txt

    Then you would execute it as:

    mycustomcopy.bat C:\vpn-folder\ M:\ubuntu-xps-files\

    Or if you need it to be more specific you would do:

    mycustomcopy.bat C:\vpn-folder\NewFiles M:\ubuntu-xps-files\

    Then all of your files in vpn-folder that begin with NewFiles and end in .doc would now be in the ubuntu-xps-files folder and ending in .txt.
    Jumping on the IT blogging band wagon -- http://www.jefferyland.com/
  • aueddonlineaueddonline Member Posts: 611 ■■□□□□□□□□
    hey thanks so much for the help man. I ended up with

    a batch called covert.bat

    copy %1*.doc %2*.txt


    and another batch

    cd C:\Users\user\Documents\sys-programs\development

    convert.bat C:\vpn-folder\ M:\ubuntu-xps-files\



    which is doing the job fine, how do I tell it to include all subdirectories
    What's another word for Thesaurus?
  • undomielundomiel Member Posts: 2,818
    Then just use xcopy /E %1.doc %2.txt

    Call it the exact same way as you did. It will preserve the complete directory structure, even empty folders.
    Jumping on the IT blogging band wagon -- http://www.jefferyland.com/
  • aueddonlineaueddonline Member Posts: 611 ■■□□□□□□□□
    there's nothing quite like pressing a button and watching your computer do a pain in the arse job in a few seconds, I added some xcopy line in covert.bat so all the other files got copied,

    thanks again undomiel
    What's another word for Thesaurus?
Sign In or Register to comment.