Hello all
Hello all

Reputation: 91

How to run specified program?

How can I make it so that when a user clicks a button (in VB.NET or C#, preferably VB) it runs the Intel AppUp Center if the user has it on his/her machine? would I use a proccess for this? Would this work?

  1. Find if PC is 32 or 64 bit
  2. if 32, go to default "C:\Program Files\Intel\IntelAppStore\bin\appup_intel.exe", if 64, go to "C:\Program Files(x86)\Intel\IntelAppStore\bin\appup_intel.exe
  3. run specified path.

is there something wrong with including the (x86) for 64 bit machines? I mean, is the (x86) added automatically if the OS detects that the specified file is in the Program Files(x86) directory?

Upvotes: 0

Views: 358

Answers (2)

user415789
user415789

Reputation:

try
{   
 if (Directory.Exists(@"C:\Program Files (x86)\Intel\IntelAppStore\bin\appup_intel.exe")
    {
         Process p = new Process();
         p.StartInfo = new ProcessStartInfo(@"C:\Program Files (x86)\Intel\IntelAppStore\bin\appup_intel.exe");
         p.StartInfo.WorkingDirectory = @"C:\Program Files (x86)\Intel\IntelAppStore\bin";
         p.Start();
    }
    else
    {
         Process p = new Process();
         p.StartInfo = new ProcessStartInfo(@"C:\Program Files\Intel\IntelAppStore\bin\appup_intel.exe");
         p.StartInfo.WorkingDirectory = @"C:\Program Files\Intel\IntelAppStore\bin";
         p.Start();
    }
}
catch (Exception e)
{
     MessageBox.Show("Intel AppUp Center does not exist");
     MessageBox.Show(e.Message+Environmnet.NewLine+e.StackTrace);
}

Upvotes: 0

ChrisF
ChrisF

Reputation: 137128

Process.Start("Path to Intel AppUp Center")

There are various overloads for this method - the details can be found on the MSDN page - from the simple like this, to one that takes command line options and user name & password as arguments.

Upvotes: 1

Related Questions