I am trying to retrieve a directory from the registry using C#. The key (in my instance) returns:
Question is, how do I turn that into just the usable directory ("...\left 4 dead 2 demo\") so I can try to tie it into other strings ("...\left 4 dead 2 demo\steam_appid.txt", etc.)"\"c:\\program files (x86)\\steam\\steamapps\\common\\left 4 dead 2 demo\\left4dead2.exe\" \"%1\""
// Retrieve L4D2 directory string L4D2Dir = Registry.GetValue("HKEY_CLASSES_ROOT\\Applications\\left4dead2.exe\\shell\\open\\command", "", "\"c:\\program files\\steam\\steamapps\\common\\left 4 dead 2 demo\\left4dead2.exe\" \"%1\"").ToString();
Also; won't won't this work? I'm trying to write "If Steam.exe is not running, do thus"
Process[] pname = Process.GetProcessesByName("Steam.exe"); if (pname.Length == 0) { //code }