EDN Admin
Well-known member
<pre class="prettyprint Process p = new Process();
if (File.Exists(@"CrogramOneupdater.exe"))
{
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.FileName = Environment.ExpandEnvironmentVariables(@"CrogramOneupdater.exe");
p.Start();
}
else
{
Console.WriteLine("The File is either missing or is installed to a different location");
}
//string errorB = p.StandardError.ReadToEnd();//
p.WaitForExit();
//Total ICU//
if (File.Exists(@"CrogramTwoUpdater2.exe"))
{
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.FileName = Environment.ExpandEnvironmentVariables(@"CrogramTwoUpdater2.exe");
p.StartInfo.Arguments = "2";
p.Start();
}
else
{
Console.WriteLine("The File is either missing or is installed to a different location");
}[/code]
<br/>
The code above i want to look to see if the file exists at its current location and if not, the else statement runs and proceeds with the rest of the code.
Basically, it designed to run a multi-update process for a series of internal program, and if the program file is not there, it gives a message in console and moves onto the next line.
Problem is that its not doing that or running console.
<br/>
View the full article
if (File.Exists(@"CrogramOneupdater.exe"))
{
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.FileName = Environment.ExpandEnvironmentVariables(@"CrogramOneupdater.exe");
p.Start();
}
else
{
Console.WriteLine("The File is either missing or is installed to a different location");
}
//string errorB = p.StandardError.ReadToEnd();//
p.WaitForExit();
//Total ICU//
if (File.Exists(@"CrogramTwoUpdater2.exe"))
{
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.FileName = Environment.ExpandEnvironmentVariables(@"CrogramTwoUpdater2.exe");
p.StartInfo.Arguments = "2";
p.Start();
}
else
{
Console.WriteLine("The File is either missing or is installed to a different location");
}[/code]
<br/>
The code above i want to look to see if the file exists at its current location and if not, the else statement runs and proceeds with the rest of the code.
Basically, it designed to run a multi-update process for a series of internal program, and if the program file is not there, it gives a message in console and moves onto the next line.
Problem is that its not doing that or running console.
<br/>
View the full article