locked
32 bit recording to Run on 64 bit VM

    问题

  • I wonder if some one came across similar problem.

    I need to Run an .exe file to run some tests .

    now this .exe file resides in C:\programfiles\ on a 32 bit VM

    and C:\program Files (86)\ on a 64 bit VM.

    if i record on 32 bit it fails on 64 bit?

    how can i record a generic one to run on both or is there any other way ?

    thanks 


    fahad

    2012年3月12日 11:22

答案

  • fahad,

    You can use Environment.Is64BitOperatingSystem Property to determine the OS architecture.

    string path;
    if(Environment.Is64BitOperatingSystem)
    {
     path = @"C:\program Files (86)\Custom\Custom.exe";
    }
    else
    {
     path = @"C:\program Files\Custom\Custom.exe";
    }
    //Start Process - path
    -Tejas.
    • 已标记为答案 Shah10 2012年3月13日 12:06
    2012年3月13日 4:57