Discussion:
Kernel32 CreateProcess problem9s)
(too old to reply)
R.Wieser
2024-04-10 08:08:11 UTC
Permalink
Hello all,

On XPsp3:

I'm trying to use Kernel32's "CreateProcess" to run executable stuff, and
have a problem : I'm only providing the commandline (lpApplicationName is
NULL), and although it works well enough for an executable (and a .BAT file,
rather unexpected), it balks when I supply it a .VBS file.

OK, that is to be expected, as a .VBS file isn't an application (but why
than is a .BAT file accepted? The application for it is CMD.EXE).

So, I use Kernel32's "FindExecutable" to find the application. And that
works. For the above .VBS file "wscript.exe" is returned (with its full
path).

... one problem though : In the registry I've added some of the "//xxx"
arguments, and those do not come back with it. Nor is the "ScriptEngine"
keys value returned (to indicate either a .VBS or .JS script)

And not including such information in my CreateProcess call creates
problems. :-(

Question:
What DLL methods are available to retrieve such information ?

Regards,
Rudy Wieser
JJ
2024-04-10 18:32:30 UTC
Permalink
Post by R.Wieser
Hello all,
I'm trying to use Kernel32's "CreateProcess" to run executable stuff, and
have a problem : I'm only providing the commandline (lpApplicationName is
NULL), and although it works well enough for an executable (and a .BAT file,
rather unexpected), it balks when I supply it a .VBS file.
Because the kernel uses the `PATHEXT` environment variable. Similar to how
it uses the `PATH` and other environment variables.
R.Wieser
2024-04-11 07:54:54 UTC
Permalink
JJ,
Post by JJ
... it works well enough for an executable ..., it balks when
I supply it a .VBS file.
Because the kernel uses the `PATHEXT` environment variable. Similar
to how it uses the `PATH` and other environment variables.
I'm afraid you'll need to explain that to me.

On my 'puter .VBS is definitily included in there.

And yes, I too thought that anything in there would be recognised and
executed. It turns out I was wrong. :-\

Regards,
Rudy Wieser

Loading...