Welcome Guest! To access all forums & features, please register an account or sign-in. → Why register?



[Win7] Help with Start command


11 replies to this topic - - - - -

#1 watchthisspace

    Cheese Grator

  • 451 posts
  • Joined: 09-June 09
  • Location: 127.0.0.1
  • OS: Windows
  • Phone: iPhone

Posted 19 June 2012 - 01:41

I'm just making a wee batch file that will start a few programs for me, one being the Teamspeak program. However when I type:

start C:\Program Files\TeamSpeak 3 Client\tsclient_win64.exe

I get an error say it cannot find the path "C:\program"

What am I doing wrong? I've tried encapsulating the path with double quotes, but still no luck.


#2 g0dzilla

    Neowinian²

  • 168 posts
  • Joined: 10-April 12
  • Location: Sydney, Australia
  • OS: Windows 7 x64 Ultimate, Windows 8 CP x64, and Mac OSX Lion
  • Phone: Jailbroken iPhone 4 GSM iOS 5.1.1

Posted 20 June 2012 - 08:51

As far as I can tell, you need to encapsulate only the parts of the file path that DO contain spaces; rather than the whole file path. Sounds silly but it seems to work from my testing. So you would re-write your batch file to be the following:

start C:\"Program Files"\"TeamSpeak 3 Client"\tsclient_win64.exe

From this website: http://www.computerh...om/starthlp.htm

"If the file or folder has a space in it you must surround it with quotes. Without the quotes surrounding the file name with a space you would get a windows cannot find the file error."

#3 +Daedroth

    Resident Fanatic

  • 943 posts
  • Joined: 15-June 11
  • Location: UK

Posted 20 June 2012 - 09:05

This may be of some help: http://stackoverflow...-command-with-s

Basically, you need it to say:

START "" "C:\Program Files\TeamSpeak 3 Client\tsclient_win64.exe"

To explain that...

The first "" after START is for the title of the command window. Since you don't need anything, it's not needed, so "" means nothing basically. Then you add your file path. Since it contains spaces, that also needs to be encapsulated in speech marks.

#4 g0dzilla

    Neowinian²

  • 168 posts
  • Joined: 10-April 12
  • Location: Sydney, Australia
  • OS: Windows 7 x64 Ultimate, Windows 8 CP x64, and Mac OSX Lion
  • Phone: Jailbroken iPhone 4 GSM iOS 5.1.1

Posted 20 June 2012 - 09:59

View PostDaedroth, on 20 June 2012 - 09:05, said:

This may be of some help: http://stackoverflow...-command-with-s

Basically, you need it to say:

START "" "C:\Program Files\TeamSpeak 3 Client\tsclient_win64.exe"

To explain that...

The first "" after START is for the title of the command window. Since you don't need anything, it's not needed, so "" means nothing basically. Then you add your file path. Since it contains spaces, that also needs to be encapsulated in speech marks.

Or that...

It all comes down to CMD syntax. You could always enter the /? switch after any CMD command to review its syntax/uses first.

#5 OP watchthisspace

    Cheese Grator

  • 451 posts
  • Joined: 09-June 09
  • Location: 127.0.0.1
  • OS: Windows
  • Phone: iPhone

Posted 21 June 2012 - 08:58

Thanks for the help guys, I tried both methods but neither seem to work.

However if I try another program, it will work fine. Which does have me stumped. I tried Start "" "C:\program files\ccleaner\ccleaner64.exe" will work. Odd.

#6 +Daedroth

    Resident Fanatic

  • 943 posts
  • Joined: 15-June 11
  • Location: UK

Posted 21 June 2012 - 09:11

If you type: "C:\Program Files\TeamSpeak 3 Client\tsclient_win64.exe" (with the quotes) in a run command, does it load?

#7 OP watchthisspace

    Cheese Grator

  • 451 posts
  • Joined: 09-June 09
  • Location: 127.0.0.1
  • OS: Windows
  • Phone: iPhone

Posted 24 June 2012 - 06:29

View PostDaedroth, on 21 June 2012 - 09:11, said:

If you type: "C:\Program Files\TeamSpeak 3 Client\tsclient_win64.exe" (with the quotes) in a run command, does it load?

Sadly, it doesn't load and another CMD prompt loads.

This is really strange, I might reinstall TeamSpeak and see if that fixes it.

#8 g0dzilla

    Neowinian²

  • 168 posts
  • Joined: 10-April 12
  • Location: Sydney, Australia
  • OS: Windows 7 x64 Ultimate, Windows 8 CP x64, and Mac OSX Lion
  • Phone: Jailbroken iPhone 4 GSM iOS 5.1.1

Posted 25 June 2012 - 12:02

Yes that is odd?!

I tested using an EXE in Program Files using both methods and they both worked fine.

Maybe write the batch script to change to the associated Program Files directory first and then run the file on the next line:

@echo off

cd C:\Program Files\TeamSpeak 3 Client

tsclient_win64.exe

#9 OP watchthisspace

    Cheese Grator

  • 451 posts
  • Joined: 09-June 09
  • Location: 127.0.0.1
  • OS: Windows
  • Phone: iPhone

Posted 25 June 2012 - 23:40

View Postg0dzilla, on 25 June 2012 - 12:02, said:

Yes that is odd?!

I tested using an EXE in Program Files using both methods and they both worked fine.

Maybe write the batch script to change to the associated Program Files directory first and then run the file on the next line:

@echo off

cd C:\Program Files\TeamSpeak 3 Client

tsclient_win64.exe

Thats works thanks for all the help! :)

#10 g0dzilla

    Neowinian²

  • 168 posts
  • Joined: 10-April 12
  • Location: Sydney, Australia
  • OS: Windows 7 x64 Ultimate, Windows 8 CP x64, and Mac OSX Lion
  • Phone: Jailbroken iPhone 4 GSM iOS 5.1.1

Posted 26 June 2012 - 07:47

Ok that's great to hear then; happy to help!

Odd that it didn't work with the START command but oh well, work-around it is :)

#11 pusatkomputerindo

    Neowinian

  • 2 posts
  • Joined: 22-June 12

Posted 29 June 2012 - 01:17

Ahh...congrats...problem solved.. :D
But, is'nt it lots easier if you just make a shorcut?

#12 g0dzilla

    Neowinian²

  • 168 posts
  • Joined: 10-April 12
  • Location: Sydney, Australia
  • OS: Windows 7 x64 Ultimate, Windows 8 CP x64, and Mac OSX Lion
  • Phone: Jailbroken iPhone 4 GSM iOS 5.1.1

Posted 29 June 2012 - 03:11

View Postpusatkomputerindo, on 29 June 2012 - 01:17, said:

Ahh...congrats...problem solved.. :D
But, is'nt it lots easier if you just make a shorcut?

He is making a batch file to start multiple programs, so shortcuts will not be as effective...