Shellexecute give error 9

04/29/2016 12:59 LiveLong23#1
Hi

I try to run game like this and give me error 9 and title of a window is error 10, i looked here [Only registered and activated users can see links. Click Here To Register...] for error code but i dont know what it means.

Code:
$game = RegRead('HKEY_CURRENT_USER\Software\FWstarter', 'Pem path')
$user = 'email'
$pass = 'password'
$id = 'arc:1'

ShellExecute($game, ' '&$id&' user:'&$user&' pwd:'&$pass)

If @error Then
	ConsoleWrite(@error & @extended)
Else
	ConsoleWrite('all ok')
EndIf

;~ ConsoleWrite($game)

;~ "D:\Igre\Forsaken World_en\update\pem.exe" arc:1 user:email pwd:password
It works like this on shortcut

Target : "D:\Igre\Forsaken World_en\update\pem.exe" arc:1 user:email pwd: password
Start In : "D:\Igre\Forsaken World_en\update"
04/29/2016 20:14 elmarcia#2
U need to specify the working dir to make sure your game will run in that location
PHP Code:
$game RegRead('HKEY_CURRENT_USER\Software\FWstarter''Pem path')
$user 'email'
$pass 'password'
$id 'arc:1'

$commandLine $id&' user:'&$user&' pwd:'&$pass

$workingDir 
StringRegExpReplace($game,"pem.exe","")

ShellExecute($game,$commandLine,$workingDir)
If @
error Then
    ConsoleWrite
(@error & @extended)
Else
    
ConsoleWrite('all ok')
EndIf 
04/29/2016 20:22 LiveLong23#3
Thank you, i forgot for working dir i was think it will work in single line but no.