Solved

vb.net and launching an app from the cmd line

Posted on 2014-12-23
6
260 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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 …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

785 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