• Kernel32 CreateProcess problem9s)

    From R.Wieser@21:1/5 to All on Wed Apr 10 10:08:11 2024
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to R.Wieser on Thu Apr 11 01:32:30 2024
    On Wed, 10 Apr 2024 10:08:11 +0200, R.Wieser wrote:
    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.

    Because the kernel uses the `PATHEXT` environment variable. Similar to how
    it uses the `PATH` and other environment variables.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Thu Apr 11 09:54:54 2024
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)