Click here to Skip to main content
15,888,968 members
Home / Discussions / C#
   

C#

 
GeneralRe: Execute a remote .exe file with switches using Proccess class Pin
Don Dang19-Sep-07 12:27
Don Dang19-Sep-07 12:27 
GeneralRe: Execute a remote .exe file with switches using Proccess class Pin
Dave Kreskowiak19-Sep-07 15:16
mveDave Kreskowiak19-Sep-07 15:16 
GeneralRe: Execute a remote .exe file with switches using Proccess class Pin
PIEBALDconsult19-Sep-07 17:52
mvePIEBALDconsult19-Sep-07 17:52 
GeneralRe: Execute a remote .exe file with switches using Proccess class Pin
Dave Kreskowiak20-Sep-07 1:56
mveDave Kreskowiak20-Sep-07 1:56 
GeneralRe: Execute a remote .exe file with switches using Proccess class Pin
Don Dang19-Sep-07 9:11
Don Dang19-Sep-07 9:11 
GeneralRe: Execute a remote .exe file with switches using Proccess class Pin
Don Dang19-Sep-07 9:20
Don Dang19-Sep-07 9:20 
AnswerRe: Execute a remote .exe file with switches using Proccess class Pin
ChrisKo18-Sep-07 11:19
ChrisKo18-Sep-07 11:19 
GeneralRe: Execute a remote .exe file with switches using Proccess class Pin
Don Dang18-Sep-07 11:58
Don Dang18-Sep-07 11:58 
Hi Chris,
I changed my code to use the Process.StartInfo.Argument to set the command lines and I still get an error. My error is "the parameter is incorrect."
private void ConnectToDataServer(string servername)
{
try
{
string execPath = @"\\" + servername + @"\E:\datacenter\";
string filePath = execPath + "HSMDiskStatus.exe";
string password = "password";
Process proc = new Process();

proc.StartInfo.Domain = servername;
proc.StartInfo.FileName = filePath;
proc.StartInfo.Arguments =@"/F e:\DPSanChart\" + servername + ".txt";


proc.StartInfo.UserName = @"domain\user";

System.Security.SecureString secret = new System.Security.SecureString();
foreach (char c in password)
{
secret.AppendChar(c);
}

proc.StartInfo.UseShellExecute = false;
proc.StartInfo.Password = secret;
proc.StartInfo.WorkingDirectory = execPath;

proc.Start();

while (!proc.HasExited)
{
proc.Refresh();
}
proc.Close();

}
catch (Exception ex)
{
throw;
}

On a different note what is the advantage of seeing the stack. What is the stack? I look at the detail of the error within the catch block and the error looks the same to me...)
GeneralRe: Execute a remote .exe file with switches using Proccess class Pin
ChrisKo18-Sep-07 12:26
ChrisKo18-Sep-07 12:26 
GeneralRe: Execute a remote .exe file with switches using Proccess class Pin
Don Dang18-Sep-07 12:36
Don Dang18-Sep-07 12:36 
GeneralRe: Execute a remote .exe file with switches using Proccess class Pin
ChrisKo18-Sep-07 13:46
ChrisKo18-Sep-07 13:46 
AnswerRe: Execute a remote .exe file with switches using Proccess class Pin
PIEBALDconsult19-Sep-07 13:32
mvePIEBALDconsult19-Sep-07 13:32 
GeneralRegular Expressions [modified] Pin
#realJSOP18-Sep-07 10:27
mve#realJSOP18-Sep-07 10:27 
GeneralRe: Regular Expressions Pin
Jonathan [Darka]18-Sep-07 10:30
professionalJonathan [Darka]18-Sep-07 10:30 
GeneralRe: Regular Expressions Pin
#realJSOP18-Sep-07 10:36
mve#realJSOP18-Sep-07 10:36 
GeneralRe: Regular Expressions Pin
Jonathan [Darka]18-Sep-07 10:53
professionalJonathan [Darka]18-Sep-07 10:53 
GeneralRe: Regular Expressions Pin
Kevin McFarlane18-Sep-07 10:39
Kevin McFarlane18-Sep-07 10:39 
GeneralRe: Regular Expressions Pin
Chris Losinger18-Sep-07 10:42
professionalChris Losinger18-Sep-07 10:42 
GeneralRe: Regular Expressions Pin
#realJSOP18-Sep-07 10:51
mve#realJSOP18-Sep-07 10:51 
GeneralRe: Regular Expressions Pin
ChrisKo18-Sep-07 10:50
ChrisKo18-Sep-07 10:50 
GeneralRe: Regular Expressions Pin
Rocky Moore18-Sep-07 10:53
Rocky Moore18-Sep-07 10:53 
GeneralRe: Regular Expressions Pin
Shog918-Sep-07 11:03
sitebuilderShog918-Sep-07 11:03 
GeneralRe: Regular Expressions Pin
#realJSOP18-Sep-07 23:45
mve#realJSOP18-Sep-07 23:45 
JokeRe: Regular Expressions Pin
Rama Krishna Vavilala18-Sep-07 11:04
Rama Krishna Vavilala18-Sep-07 11:04 
GeneralRe: Regular Expressions Pin
markkuk18-Sep-07 11:07
markkuk18-Sep-07 11:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.