CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2011
    Posts
    3

    need help in process.start()

    I'm trying to run a game from within c#, problem is c# copies the exe file into its own directory, thus the game files are not present and the exe fails to run alone
    here's what i have so far
    ProcessStartInfo psi =new ProcessStartInfo(@"C:\program files\tibia\tibia.exe");
    Process.Start(psi);

    i want c# to run tibia.exe inside C:\program files\tibia instead of copying the executable

  2. #2
    Join Date
    Jan 2002
    Location
    Scaro, UK
    Posts
    5,940

    Re: need help in process.start()

    Why is the c# copying the exe into it's local folder ? Are you adding the game exe as a reference ? It won't do this by default. You shouldn't be adding the exe as a reference anyway if you are doing this.

    You'll probably need to set the working directory in ProcessStart to the folder where the target exe is.

    Darwen.
    www.pinvoker.com - PInvoker - the .NET PInvoke Interface Exporter for C++ Dlls.

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: need help in process.start()

    set the working directory to the exe's directory.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured