Process.Start says file not found

S

sjoshi23

Hello

I'm trying to start a remote desktop session using Process.Start but
it keeps saying "File not found". The same cmd thru DOS window works
fine.

I used: C:\\WINDOWS\\system32\\mstsc.exe /v:SP3DLAB4


Any hints ?

thanks
Sunit
 
S

sjoshi23

Quid pro quo.  You give us hints about your code first.  :)  So far, you  
haven't described anything about how your code tries to do this, so it's  
not fair to ask anyone why it's not working.

Post the code.

Like I mentioned, I use Process.Start(cmdLine) to start a remote
desktop where cmdLine = "C:\\WINDOWS\\system32\\mstsc.exe /v:SP3DLAB4
"

Sunit
 
Z

zacks

Like I mentioned, I use Process.Start(cmdLine) to start a remote
desktop where cmdLine =  "C:\\WINDOWS\\system32\\mstsc.exe /v:SP3DLAB4
"

I may be wrong, but I think the problem is that the command you are
trying to run has a parameter on the command line. I believe if you
try to start a process with:

Process.Start(filename);

all filename can be is the name of a file, not the name of a file
followed by a parameter. I think you will have to instantiate a
Process object, set the StartInfo filename with the path to the RDP
program, and set the StartInfo parameters to the parameter, then do a
processobject.Start() method.
 
S

sjoshi23

I may be wrong, but I think the problem is that the command you are
trying to run has a parameter on the command line. I believe if you
try to start a process with:

Process.Start(filename);

all filename can be is the name of a file, not the name of a file
followed by a parameter. I think you will have to instantiate a
Process object, set the StartInfo filename with the path to the RDP
program, and set the StartInfo parameters to the parameter, then do a
processobject.Start() method.

Thanks...just used Process.Start("mstsc.exe", "/v:LAB5") and that did
it.

Sunit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top