1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Creating a .bat with spaces in file name...

Discussion in 'Windows Vista' started by shhhhh, Feb 3, 2009.

Thread Status:
Not open for further replies.
Advertisement
  1. shhhhh

    shhhhh Thread Starter

    Joined:
    Feb 3, 2009
    Messages:
    3
    Hello all,

    I'm trying set up a batch file to open an excel sheet this is the code...

    start /d "C:\Users\My Name\Documents\Stock stuff\Stock Screen.xls"

    However it seems it is not recognizing the file name I've tried tons of variations but it always returns with either cannot recognize Stock, or cannot recognize screen.

    I am using windows vista. This is the correct path, I used shift + right mouse button just to ensure that fact.


    Thank you all for your help!
    Shhhhh
     
  2. shhhhh

    shhhhh Thread Starter

    Joined:
    Feb 3, 2009
    Messages:
    3
    bump... I'm really at a loss here if anyone has any thoughts I'd truly appreciate it!

    Thank you all,
    Shhhhh
     
  3. TerryNet

    TerryNet Terry Moderator

    Joined:
    Mar 23, 2005
    Messages:
    69,562
    The /d parameter calls for a path name, not a file name. What is the entire command line you are using?

    I don't know your purpose here, but to open a spreadsheet in the default application all you need in your batch file is

    "C:\Users\My Name\Documents\Stock stuff\Stock Screen.xls"
     
  4. Gulo Luseus

    Gulo Luseus

    Joined:
    May 12, 2007
    Messages:
    2,282
    Not solving the direct problem, but would a shortcut not do the job? as you are in Vista would be a lot easier, unless you are reverting to a different environment? :)
     
  5. koen7

    koen7

    Joined:
    Nov 10, 2008
    Messages:
    78
    start "" "c:\users\..."
     
  6. shhhhh

    shhhhh Thread Starter

    Joined:
    Feb 3, 2009
    Messages:
    3
    Thank you all so much for all your assistance. A combination of all your answers did the trick.

    I removed the /d parameter. and originally dropped the start command as well, but that was not working, finally Koen's suggestion

    start "" "c:\users...

    That did the trick!

    For those who were wondering what my intentions are.... I work from home and everyday when I start computer I have to open 8 separate excel files, plus numerous other files. trying to create on batch to do it all!

    Again thank you all!
    Shhhhh
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/797081