Solved

vb.net and launching an app from the cmd line

Posted on 2014-12-23
6
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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 …
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.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

740 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