Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Start an application

Reply
 
Old 11-20-2008   #1 (permalink)
JT


 
 

Start an application

I am trying to start (run) an application from a vbscript.

I have tried various methods of getting to the correct path and came up with
the following.

app_dir= "E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\"
app_exe= "ssh-client-g3.exe"
ObjShell.Run app_dir & app_exe

The paths are correct but I get the error msg 'the system cannot find the
file specified'.

Any suggestions on form or syntax for getting this applicaiton to run would
be greatly appreciated! thanks,

JT

My System SpecsSystem Spec
Old 11-20-2008   #2 (permalink)
Pegasus \(MVP\)


 
 

Re: Start an application


"JT" <JT@xxxxxx> wrote in message
news:E2E8C3A9-075C-44BC-A384-F85B9CE54ED9@xxxxxx
Quote:

>I am trying to start (run) an application from a vbscript.
>
> I have tried various methods of getting to the correct path and came up
> with
> the following.
>
> app_dir= "E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\"
> app_exe= "ssh-client-g3.exe"
> ObjShell.Run app_dir & app_exe
>
> The paths are correct but I get the error msg 'the system cannot find the
> file specified'.
>
> Any suggestions on form or syntax for getting this applicaiton to run
> would
> be greatly appreciated! thanks,
>
> JT
These problems are best solved by giving yourself some eyes. Instead of
coding
ObjShell.Run app_dir & app_exe
you might code
wscript.echo app_dir & app_exe

You will immediately see that you're trying to execute the following
command:
E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\ssh-client-g3.exe

It is now obvious that this cannot possibly work because the path contains
embedded spaces. You must surround the whole lot by one set of double quotes
so that the Windows Command Processor knows that it is one single file name:

ObjShell.Run """" & app_dir & app_exe & """"


My System SpecsSystem Spec
Old 11-20-2008   #3 (permalink)
JT


 
 

Re: Start an application

Thank you so much for your reply. Your options works and I can also make the
application run with
("""E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\ssh-client-g3.exe""")

I don't understand the quote to space correlation.
If my application path had no spaces in it would I need quotes around the
path or simply parentheses? Do I need on set of quotes for every space?

Thank you.

"Pegasus (MVP)" wrote:
Quote:

>
> "JT" <JT@xxxxxx> wrote in message
> news:E2E8C3A9-075C-44BC-A384-F85B9CE54ED9@xxxxxx
Quote:

> >I am trying to start (run) an application from a vbscript.
> >
> > I have tried various methods of getting to the correct path and came up
> > with
> > the following.
> >
> > app_dir= "E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\"
> > app_exe= "ssh-client-g3.exe"
> > ObjShell.Run app_dir & app_exe
> >
> > The paths are correct but I get the error msg 'the system cannot find the
> > file specified'.
> >
> > Any suggestions on form or syntax for getting this applicaiton to run
> > would
> > be greatly appreciated! thanks,
> >
> > JT
>
> These problems are best solved by giving yourself some eyes. Instead of
> coding
> ObjShell.Run app_dir & app_exe
> you might code
> wscript.echo app_dir & app_exe
>
> You will immediately see that you're trying to execute the following
> command:
> E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\ssh-client-g3.exe
>
> It is now obvious that this cannot possibly work because the path contains
> embedded spaces. You must surround the whole lot by one set of double quotes
> so that the Windows Command Processor knows that it is one single file name:
>
> ObjShell.Run """" & app_dir & app_exe & """"
>
>
>
My System SpecsSystem Spec
Old 11-20-2008   #4 (permalink)
Pegasus \(MVP\)


 
 

Re: Start an application

Try this:
- Click Start / Run / cmd{OK}
- Type this command:
E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\ssh-client-g3.exe

Does it work? No! It says
'E:\Program' is not recognized as an internal or external command, operable
program or batch file.
Why? Because the Command Process thinks that "E:\Program" is the name of the
application you're trying to run and that the rest are parameters. However,
when you type the command
"E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\ssh-client-g3.exe" then
there is no problem, because the Command Processor now knows that it must
treat the whole string between double quotes as a command.

If your command contained no spaces then you would not need the double
quotes. However, you should make it a habit of having them. One set of
double quotes around the whole lot will suffice.


"JT" <JT@xxxxxx> wrote in message
news:7443480C-C6E5-40CA-BF2C-38514233A326@xxxxxx
Quote:

> Thank you so much for your reply. Your options works and I can also make
> the
> application run with
> ("""E:\Program Files\UWICK\SSH Tectia\SSH Tectia
> Client\ssh-client-g3.exe""")
>
> I don't understand the quote to space correlation.
> If my application path had no spaces in it would I need quotes around the
> path or simply parentheses? Do I need on set of quotes for every space?
>
> Thank you.
>
> "Pegasus (MVP)" wrote:
>
Quote:

>>
>> "JT" <JT@xxxxxx> wrote in message
>> news:E2E8C3A9-075C-44BC-A384-F85B9CE54ED9@xxxxxx
Quote:

>> >I am trying to start (run) an application from a vbscript.
>> >
>> > I have tried various methods of getting to the correct path and came up
>> > with
>> > the following.
>> >
>> > app_dir= "E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\"
>> > app_exe= "ssh-client-g3.exe"
>> > ObjShell.Run app_dir & app_exe
>> >
>> > The paths are correct but I get the error msg 'the system cannot find
>> > the
>> > file specified'.
>> >
>> > Any suggestions on form or syntax for getting this applicaiton to run
>> > would
>> > be greatly appreciated! thanks,
>> >
>> > JT
>>
>> These problems are best solved by giving yourself some eyes. Instead of
>> coding
>> ObjShell.Run app_dir & app_exe
>> you might code
>> wscript.echo app_dir & app_exe
>>
>> You will immediately see that you're trying to execute the following
>> command:
>> E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\ssh-client-g3.exe
>>
>> It is now obvious that this cannot possibly work because the path
>> contains
>> embedded spaces. You must surround the whole lot by one set of double
>> quotes
>> so that the Windows Command Processor knows that it is one single file
>> name:
>>
>> ObjShell.Run """" & app_dir & app_exe & """"
>>
>>
>>

My System SpecsSystem Spec
Old 12-22-2008   #5 (permalink)
Kris Robertson


 
 

Re: Start an application



"Pegasus (MVP)" wrote:
Quote:

> Try this:
> - Click Start / Run / cmd{OK}
> - Type this command:
> E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\ssh-client-g3.exe
>
> Does it work? No! It says
> 'E:\Program' is not recognized as an internal or external command, operable
> program or batch file.
> Why? Because the Command Process thinks that "E:\Program" is the name of the
> application you're trying to run and that the rest are parameters. However,
> when you type the command
> "E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\ssh-client-g3.exe" then
> there is no problem, because the Command Processor now knows that it must
> treat the whole string between double quotes as a command.
>
> If your command contained no spaces then you would not need the double
> quotes. However, you should make it a habit of having them. One set of
> double quotes around the whole lot will suffice.
>
>
> "JT" <JT@xxxxxx> wrote in message
> news:7443480C-C6E5-40CA-BF2C-38514233A326@xxxxxx
Quote:

> > Thank you so much for your reply. Your options works and I can also make
> > the
> > application run with
> > ("""E:\Program Files\UWICK\SSH Tectia\SSH Tectia
> > Client\ssh-client-g3.exe""")
> >
> > I don't understand the quote to space correlation.
> > If my application path had no spaces in it would I need quotes around the
> > path or simply parentheses? Do I need on set of quotes for every space?
> >
> > Thank you.
> >
> > "Pegasus (MVP)" wrote:
> >
Quote:

> >>
> >> "JT" <JT@xxxxxx> wrote in message
> >> news:E2E8C3A9-075C-44BC-A384-F85B9CE54ED9@xxxxxx
> >> >I am trying to start (run) an application from a vbscript.
> >> >
> >> > I have tried various methods of getting to the correct path and came up
> >> > with
> >> > the following.
> >> >
> >> > app_dir= "E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\"
> >> > app_exe= "ssh-client-g3.exe"
> >> > ObjShell.Run app_dir & app_exe
> >> >
> >> > The paths are correct but I get the error msg 'the system cannot find
> >> > the
> >> > file specified'.
> >> >
> >> > Any suggestions on form or syntax for getting this applicaiton to run
> >> > would
> >> > be greatly appreciated! thanks,
> >> >
> >> > JT
> >>
> >> These problems are best solved by giving yourself some eyes. Instead of
> >> coding
> >> ObjShell.Run app_dir & app_exe
> >> you might code
> >> wscript.echo app_dir & app_exe
> >>
> >> You will immediately see that you're trying to execute the following
> >> command:
> >> E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\ssh-client-g3.exe
> >>
> >> It is now obvious that this cannot possibly work because the path
> >> contains
> >> embedded spaces. You must surround the whole lot by one set of double
> >> quotes
> >> so that the Windows Command Processor knows that it is one single file
> >> name:
> >>
> >> ObjShell.Run """" & app_dir & app_exe & """"
> >>
> >>
> >>
>
>
>
Hate to be rude, but yes it does work

I clicked, start > run and typed exactly:

c:\Program Files\CCP\EVE\Eve.exe

no quotations with a space between Program and Files.

Game executed normally.

Just thought I would let you know.

Running Windows XP SP3
My System SpecsSystem Spec
Old 12-22-2008   #6 (permalink)
Pegasus \(MVP\)


 
 

Re: Start an application


"Kris Robertson" <KrisRobertson@xxxxxx> wrote in message
news:2B207BD4-8ADE-46FC-A7DA-E0014DFEF255@xxxxxx
Quote:

>
>
> "Pegasus (MVP)" wrote:
>
Quote:

>> Try this:
>> - Click Start / Run / cmd{OK}
>> - Type this command:
>> E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\ssh-client-g3.exe
>>
>> Does it work? No! It says
>> 'E:\Program' is not recognized as an internal or external command,
>> operable
>> program or batch file.
>> Why? Because the Command Process thinks that "E:\Program" is the name of
>> the
>> application you're trying to run and that the rest are parameters.
>> However,
>> when you type the command
>> "E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\ssh-client-g3.exe"
>> then
>> there is no problem, because the Command Processor now knows that it must
>> treat the whole string between double quotes as a command.
>>
>> If your command contained no spaces then you would not need the double
>> quotes. However, you should make it a habit of having them. One set of
>> double quotes around the whole lot will suffice.
>>
>>
>> "JT" <JT@xxxxxx> wrote in message
>> news:7443480C-C6E5-40CA-BF2C-38514233A326@xxxxxx
Quote:

>> > Thank you so much for your reply. Your options works and I can also
>> > make
>> > the
>> > application run with
>> > ("""E:\Program Files\UWICK\SSH Tectia\SSH Tectia
>> > Client\ssh-client-g3.exe""")
>> >
>> > I don't understand the quote to space correlation.
>> > If my application path had no spaces in it would I need quotes around
>> > the
>> > path or simply parentheses? Do I need on set of quotes for every
>> > space?
>> >
>> > Thank you.
>> >
>> > "Pegasus (MVP)" wrote:
>> >
>> >>
>> >> "JT" <JT@xxxxxx> wrote in message
>> >> news:E2E8C3A9-075C-44BC-A384-F85B9CE54ED9@xxxxxx
>> >> >I am trying to start (run) an application from a vbscript.
>> >> >
>> >> > I have tried various methods of getting to the correct path and came
>> >> > up
>> >> > with
>> >> > the following.
>> >> >
>> >> > app_dir= "E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\"
>> >> > app_exe= "ssh-client-g3.exe"
>> >> > ObjShell.Run app_dir & app_exe
>> >> >
>> >> > The paths are correct but I get the error msg 'the system cannot
>> >> > find
>> >> > the
>> >> > file specified'.
>> >> >
>> >> > Any suggestions on form or syntax for getting this applicaiton to
>> >> > run
>> >> > would
>> >> > be greatly appreciated! thanks,
>> >> >
>> >> > JT
>> >>
>> >> These problems are best solved by giving yourself some eyes. Instead
>> >> of
>> >> coding
>> >> ObjShell.Run app_dir & app_exe
>> >> you might code
>> >> wscript.echo app_dir & app_exe
>> >>
>> >> You will immediately see that you're trying to execute the following
>> >> command:
>> >> E:\Program Files\UWICK\SSH Tectia\SSH Tectia Client\ssh-client-g3.exe
>> >>
>> >> It is now obvious that this cannot possibly work because the path
>> >> contains
>> >> embedded spaces. You must surround the whole lot by one set of double
>> >> quotes
>> >> so that the Windows Command Processor knows that it is one single file
>> >> name:
>> >>
>> >> ObjShell.Run """" & app_dir & app_exe & """"
>> >>
>> >>
>> >>
>>
>>
>>
>
> Hate to be rude, but yes it does work
>
> I clicked, start > run and typed exactly:
>
> c:\Program Files\CCP\EVE\Eve.exe
>
> no quotations with a space between Program and Files.
>
> Game executed normally.
>
> Just thought I would let you know.
>
> Running Windows XP SP3
I hate to be rude too but you obviously missed the my first step:
- Click Start / Run / cmd{OK}

This will start a Command Prompt, and in a Command Prompt you do need the
double quotes around paths containing spaces. You operated from the Start
button, which uses a different mechanism to launch applications.

Just thought I would let you know . . .


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
getting application to start up on second monitor Vista General
Start application minimized Vista performance & maintenance
-- Can not start application -- Vista installation & setup
Wish to eliminate a start-up application Vista performance & maintenance
My application doesn't start Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46