Solved

vb.net and launching an app from the cmd line

Posted on 2014-12-23
6
250 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>>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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

772 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

10 Experts available now in Live!

Get 1:1 Help Now