shellexe - error 5

James2
20 Apr 2006, 22:20
I'm using 'shellexe' to run an exe and always get 'runtime error 5 Invalid procedure or argument' (then the Quest runtime crashes). I've tried it with several programs, all with the full path and no arguments. Error 5 does not appear in the help file.

Can any one help ?

James2
24 Apr 2006, 20:34
Done some more experimentation:
if I use shell then I get return value of 1 (shell exe OK) but nothing happens (ie exe is not run)

A security question come up before the exe is run saying permisson not given to run exe, but asking if want to run exe - I answer yes. In manual says exe some times not possible due to Quest security but no further info on Quest security, I'm confused ~~~

any thoughts ? I'd realy like to get an external prog to run.

paul_one
24 Apr 2006, 21:14
What external program are you running?
What usually comes up when you run this program?
Could you tell me what you're choosing in QDK (or coding if you're coding by hand) and what is typed to run this program?

You could always zip it all up and email it to me - old486whizz@hotmail.com

James2
24 Apr 2006, 22:07
Here's code (created in QDK, cut down to isolate problem, sub edited using TextPad, will run in Quest {to demo fault} as is)

' "villa"
' Created with QDK 3.53 - UNREGISTERED VERSION

define game <villa>
asl-version <350>
gametype singleplayer
start <hill>
game author <James>
game version <0.1>
game info <Created with QDK 3.53 - UNREGISTERED EVALUATION VERSION.>
end define

define synonyms
end define

define room <hill>
look <type USE TELESCOPE>
command <use telescope> {
shell <c:\WINNT\system32\notepad.exe>
' you may need to replace the exe
' on my system (Win NT Prof) a security window pops up stating
' This game wants to execute the following file
' c:\WINNT\system32\notepad.exe
' This file type:
' EXE (program)
' which is disallowed by your Security Options
' do you wish to run this file
' y/n

' if y then notepad is NOT run
'
' shellexe<c:\WINNT\system32\notepad.exe>
' gets a error 5 & crashes the Quest run time
msg <return =%quest.shellsuccess%>
' return value = 1 for shell cmd
}

define object <telescope>
look <it's an old telescope>
take msg <it's too heavy to move, use it where it is>
examine <looking through in at one end and you see a very small world, use the other end>
prefix <the>
article <it>
gender <it>
end define

end define

define text <intro>

end define

define text <win>

end define

define text <lose>

end define

paul_one
24 Apr 2006, 23:50
OK, cool...

So that file DOES exist yeah?
I mean - you can run it from the command line, or doing a "windows key+R" and typing it in that run dialog box.

I can't really do any testing right now as I'm in Linux... But I'll do a quick reset, experiment and get back to you tomoz.

paul_one
25 Apr 2006, 12:53
Just a note to Alex - trying shell or shellexe with a totalpath doesn't work - I guess this is executing in the local directory though.. When you just put an invalid filename (say "notepad.exe") it crashes Quest - with two different error codes if I remember right.

Anyway, I found a solution for you James.
Make a shortcut to notepad, make a new shortcut, then in the address put:
%windir%\system32\notepad.exe

... Or miss out the system32 bit cos all of the windows have notepad in the windows folder as far as I know.

%windir% get's turned into the machine's windows directory automatically - so it'll work just transferring the files directly to another machine.
Then you put this shortcut into the folder with the game in, and it'll run.

James2
25 Apr 2006, 15:39
Thanks tr0n.

It's the relative path that sorts it out (just a short cut in the Quest run dir).

should we have a note to that effect in the manual ?

Was error 5 (and crash) an random event or should it happen & thus indicate some thing is wrong >

paul_one
25 Apr 2006, 17:55
I don't know... I suppose that it should have "reletive to the game/quest directory" - and that entire path's don't work.

That crash shouldn't happen - it means there's a part of quest that isn't being monitored properly.