Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

simple batch file - Help?

Options
  • 05-06-2003 11:33am
    #1
    Registered Users Posts: 771 ✭✭✭


    newbie question:

    i have a word document in the same folder as a batch file

    I want the batch file to open/run the document and launch it in
    the default application, for me it's word.

    what's the syntax for the .bat

    exec word.doc


    or something


Comments

  • Registered Users Posts: 1,931 ✭✭✭Zab


    start word.doc


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    depending on your operating system


    word.doc on it's own may work.

    Otherwise try

    start word.doc


    type 'start /?' for other options.


  • Closed Accounts Posts: 1,719 ✭✭✭Ruaidhri


    for the batch file

    %1

    and the syntax is

    <batchfilename> word.doc

    afaik windows will execute it for you anyway if you provide an extension.


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    At the risk of asking a really dumb question...why would you want to do this?

    jc


  • Registered Users Posts: 1,865 ✭✭✭Syth


    <programmes name/path> <filename/path>

    eg word somefile.doc.
    I don't know if it'll work with word, but if you were to use edit (a DOS text editor), it'd go like:
    edit file.txt
    then it'd automatically open file.txt in edit. I don't know if word accepts filenames in the command line...


  • Advertisement
  • Registered Users Posts: 604 ✭✭✭Kai


    if you want to use VB then try :


    shell docName.doc

    and save the file as a .vbs, eg startdoc.vbs`
    This will open it in the Default app for that file.

    or else try
    shell (word.exe docname.doc)

    to mae sure it opens in Word.


Advertisement