Jump to content

Run program from registry


Gordoni
 Share

Recommended Posts

Func  _Diablo_Run()($iMode = -1, $iWait = 5)
    If $iMode = -1 And ProcessExists("game.exe") Then Return 1
    
    Local $iAutoItVersion_Compare = _VersionCompareEx(@AutoItVersion, "3.2.10.0")
    
    If $iAutoItVersion_Compare <= 0 Then Local $iOld_Opt_REF = Opt("RunErrorsFatal", 0)
    
    Local $iError = 0, $iPID
    Local $sDiabloII_RegPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Blizzard Entertainment\DiabloII", "")
    
    If FileExists($sDiabloII_RegPath) Then
        $iPID = Run($sDiabloII_RegPath & "\Diablo2.exe")
        $iError = @error
    Else
        $iError = 1
    EndIf
    
    If $iAutoItVersion_Compare <= 0 Then Opt("RunErrorsFatal", $iOld_Opt_REF)
    
    If $iWait And Not $iError Then
        ProcessWait($iPID, $iWait)
        WinWait($sDiabloII_CLASS, "", $iWait)
    EndIf
    
    If $iError Then Return SetError(1, 0, 0)
    Return 1
EndFunc   ;==> Diablo II Start

Adding screen of registry from HKEY_LOCAL_MACHINE\SOFTWARE\Blizzard Entertainment\DiabloII

That what i have here dont wanna work . Can any 1 help me ?

post-42364-1230744844_thumb.jpg

Edited by Gordoni
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...