Shell( ) inconsistency with actual windows interfac

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have some VB scripts which start by opening an application, in this case
it is a game called FEAR (some of you may be familiar). I am using Visual
Studio 2005 Professional Edition running on Windows XP x64. I am using the
script on the same system.

I can open FEAR manually on the system; I just double click the short cut
and everything is good. However, the following line in my application does
not appear to produce the same results:

ProcID = Shell("C:\Program Files (x86)\Sierra\FEAR\FEAR.exe",
AppWinStyle.NormalFocus)

AFAIK, this should do the trick. However, it gives me a strange error
(something about being unable to initialize because it cannot get some game
resources).

Does anyone have any ideas why the shell command is giving me different
results than simply opening the app manually? I've never seen that before.
Could it be the result of some funky copy protection on the game?

Thanks in advance,


David
 
Yes, the "working directory" of the process expects to be in \FEAR but it is
actually the directory of your program. Use the "Process" object to launch
it, setting the working directory (via. the StartInfo property).
 
Back
Top