Running an external EXE in C# with respect to permissions and environment

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Eudaimonium
    New Member
    • Nov 2012
    • 2

    Running an external EXE in C# with respect to permissions and environment

    Greetings,

    I am trying to run an external EXE, or to be more specific, a Skyrim game from the small profile manager program I've written.

    Running literally any other EXE from the program is completely fine. All games that are stored and ran from the program run perfectly.

    However, when running Skyrim game from the program, it appears that the game is ran with some restrictions or otherwise is limited, because when the user attempts to load any saved games, the game will notify the user that the save games are corrupted, or based on content that is no longer there. No save games can be loaded.

    Running the game's EXE manually even when the program is running does not result in an error.

    I have tried running a simple System.Diagnost ics.Process.Sta rt but seeing it produces the error, I tried using:

    Code:
    System.Diagnostics.ProcessStartInfo game = new System.Diagnostics.ProcessStartInfo(split[1]);
    game.UseShellExecute = true;
    game.LoadUserProfile = true;
                                    System.Diagnostics.Process.Start(game);
    It still produces the error.

    I assume that this is somehow tied to running the game from seperate process instead as a user from Windows.

    Thoughts?
    Last edited by PsychoCoder; Nov 26 '12, 10:46 PM. Reason: [Z{Please use the <CODE/> button to format posted code/SQL}]
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    You're going to have to provide more detail about how you are launching the game and in what operating environment(s).

    Comment

    • Eudaimonium
      New Member
      • Nov 2012
      • 2

      #3
      Sure,

      Windows 7 OS, using Visual C# 2010 Express edition, .NET framework 4.0 environment.

      Code snipped for launching an exe is copied, thanks for properly formatting it!

      Basically, if TESV.exe is ran via the program (with code), it cannot access and load any save files which are located in Documents.

      If it's launched via double-click like a user normally would, everything works fine.

      Comment

      Working...