(Very Basic) Vista Batch Files

Discussion in 'other software & services' started by philby, Mar 27, 2009.

Thread Status:
Not open for further replies.
  1. philby

    philby Registered Member

    Joined:
    Jan 10, 2008
    Posts:
    944
    Hello there

    Just tinkering with making .bat files and would be interested in knowing if I'm doing something wrong here -

    This works:
    echo off
    start /d "C: \Program files\ccleaner (M)" ccleaner

    But this doesn't work:

    echo off
    start /d "C: \Program files\opera 10 preview" opera

    (makes no difference if I kill the spaces between opera-10-preview, or add .exe to opera)

    Grateful for any help - thanks in advance.

    philby
     
  2. pandlouk

    pandlouk Registered Member

    Joined:
    Jul 15, 2007
    Posts:
    2,976
    Why you don't use the following:
    start /d "C: \Program files\opera 10 preview\opera.exe"

    Panagiotis
     
  3. philby

    philby Registered Member

    Joined:
    Jan 10, 2008
    Posts:
    944
    start /d "C: \Program files\opera 10 preview\opera.exe"

    This doesn't work either - I just get a quick flash of the command window.

    Plus, the ccleaner .bat works without the .exe extension...

    Thanks for response.

    philby
     
  4. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,179
    Location:
    NSW, Australia
    philby,

    Try these lines without start....

    Did you mean to put a space after C:
     
    Last edited: Mar 28, 2009
  5. philby

    philby Registered Member

    Joined:
    Jan 10, 2008
    Posts:
    944
    Yes, thank you, that was it - no space after C: and it works.

    Now I don't understand why the ccleaner .bat works with the space after c:

    What's that about? I would have imagined either there must be a space or there must not be.

    Also, is there a way of preventing the command window from flashing up when the bat shortcut is hit (without TP s/w)?

    Thanks again in advance

    philby
     
  6. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,179
    Location:
    NSW, Australia
    Try this...

    The second line has wrapped. There are only 3 lines here. The second line starts with "if" and finishes with "EOF"



    Try this for ccleaner

    You won't see anything lasting more than a second. It's finished.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.