Batch file to start Excel, path has spaces

Posted on 2011-05-03
Last Modified: 2012-05-11
I have a cmd file to start excel using a certain file as a template.
Excel starts, but the file can't be found because the template location has spaces in its filepath, even if i put it in quotes

Start "" excel.exe /t"\\SERVER01\My Firm\General\TEMPLATES\Bank_Account_Monthly_Sheet.xlt"

Any ideas of how to get this to work, the 'My Firm' location has all company data on it so can't be changed.
Question by:GegH
    LVL 51

    Accepted Solution

    Do you have a space after the /t?

    Start "" excel.exe /t "\\SERVER01\My Firm\General\TEMPLATES\Bank_Account_Monthly_Sheet.xlt"


    Author Comment

    No space after the /t. only a space between 'my' and 'firm'.

    When the error comes up on opening it says it can't find:

    LVL 23

    Assisted Solution

    by:Brian Gee
    I think billprew was trying to suggest inputting a space after the /t so it reads how he typed it in his post. See if copying and pasting what he typed works for you.

    Author Comment

    That's great, thankyou.

    On a related note, i did a similar thing for word, it was working, creating a new file from a template now it seems to give me an option to open as read only.

    Any ideas as to why it would be different.
    Start "" Winword.exe /t "\\SERVER01\My Firm\General\TEMPLATES\"
    LVL 23

    Assisted Solution

    by:Brian Gee
    Open the file NOT as read-only. Go to Tools, Options, Security tab, uncheck Read-only recommended checkbox, OK, Save and then close the document. Try reopening it. You should not get this prompt again for this file.

    Author Closing Comment

    All these solutions are correct, but i guess billprew was the original answer and so should get the lions share of the credit.
    Thankyou so much for the input.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    With the internet and the ease of information transference, many professional jobs can be done anywhere today.  Why should it make a difference whether an x-ray is read in India or the United States as long as the radiologist is qualified?   Outso…
    In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
    The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
    The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now