How to exit external application in unity3d

well i know how to open a external application in unity 3d
like this
// Goes in OnGUI():
if(GUI.Button(new Rect(15, 15, 95, 35), “Open Notepad”))
{
System.Diagnostics.Process.Start(“notepad.exe”);
}

but how to close that or any other external application… java script needed urgent

1 Like

Your Process.Start call returns a Process component. Looking at the methods available on that component, you have at least a “Kill” method available. That should work, though there might be a more elegant approach (or, even a moure suitable Process method - I only took a brief look).

See:

and

Jeff

i need a java script … i know how to do it in vb but hhave to make a button in unity:(

had tried kill quite close end etc but giving me errors

just like this

  Process p;
    // Use this for initialization
    void Start()
    {
        print("eee" + Environment.CurrentDirectory);
          p = Process.Start(Environment.CurrentDirectory+ @"\oscmanager.exe - Shortcut");

       s= p.ProcessName;
    }

    void OnApplicationQuit() { p.Kill();   }