Link to home
Start Free TrialLog in
Avatar of GegH
GegHFlag for New Zealand

asked on

Batch file to start Excel, path has spaces

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.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GegH

ASKER

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:

'Firm\General\TEMPLATES\Bank_Account_Monthly_Sheet.xlt"'
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GegH

ASKER

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\Memo.dot"
WordOption.jpg
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GegH

ASKER

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.