Solved

vb.net and launching an app from the cmd line

Posted on 2014-12-23
6
257 Views
Last Modified: 2015-01-15
attempting to load a program from command line and keep getting "cannot find file specified".

If i load the below from cmd line it works fine but not when i try in vb.
C:\Windows\SysWOW64\CCM\VAppLauncher.exe /launch "Avaya CMS Supervisor R16 -- English 16.1.0.0 R2"

Open in new window


When i do the below, i get the error:

Dim process1 As New Process
        process1.StartInfo.FileName = "VAppLauncher.exe"
        process1.StartInfo.WorkingDirectory = "C:\\Windows\\SysWOW64\\CCM"
        process1.StartInfo.Arguments = (" /launch Avaya CMS Supervisor R16 -- English 16.1.0.0 R2")
        process1.Start()

Open in new window

0
Comment
Question by:derek7467
6 Comments
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 40515032
Try to put everything on the Same line like
Process.Start("VAppLauncher.exe","/launch Avaya CMS Supervisor R16 -- English 16.1.0.0 R2")

Open in new window

Just in case put the that this no work add the location of the program on the first part of the code like
Process.Start("C:\Windows\SysWOW64\CCM\VAppLauncher.exe","/launch Avaya CMS Supervisor R16 -- English 16.1.0.0 R2")

Open in new window

0
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 250 total points
ID: 40515036
I imagine you need to quote the string after "launch" due to the spaces.

Try:
Dim process1 As New Process
        process1.StartInfo.FileName = "VAppLauncher.exe"
        process1.StartInfo.WorkingDirectory = "C:\\Windows\\SysWOW64\\CCM"
        process1.StartInfo.Arguments = (" /launch ""Avaya CMS Supervisor R16 -- English 16.1.0.0 R2""")
        process1.Start()

Open in new window

0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 250 total points
ID: 40515058
You specify the working directory but not the path to where the app is (not the same thing).
Try this:
Dim process1 As New Process
        process1.StartInfo.FileName = "C:\\Windows\\SysWOW64\\CCM\\VAppLauncher.exe"
        process1.StartInfo.WorkingDirectory = "C:\\Windows\\SysWOW64\\CCM"
        process1.StartInfo.Arguments = (" /launch Avaya CMS Supervisor R16 -- English 16.1.0.0 R2")
        process1.Start()

or this as the next trial in case the arguments need quotes
Dim process1 As New Process
        process1.StartInfo.FileName = "C:\\Windows\\SysWOW64\\CCM\\VAppLauncher.exe"
        process1.StartInfo.WorkingDirectory = "C:\\Windows\\SysWOW64\\CCM"
        process1.StartInfo.Arguments = (" /launch 'Avaya CMS Supervisor R16 -- English 16.1.0.0 R2' ")
        process1.Start()
0
 

Author Comment

by:derek7467
ID: 40515104
doesnt work, now i get "cannot start application", but if i run that same code from a cmd line, it works.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 40515201
>>doesnt work, now i get "cannot start application"
Actually that sounds like one or more comments solved your original problem.  Now you have a rather different one.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now