I run a php script on localhost that contains vbscript in it to execute
a program, like so:

<?php
$scripter = new COM("MSScriptControl.ScriptControl");
$scripter->Language = "vbscript";
$scripter->ExecuteStatement("Set WshShell =
createobject(\"wscript.shell\")");
$scripter->ExecuteStatement("oExec =
WshShell.Run(\"someprogram.exe\",1,TRUE)");
$scripter->ExecuteStatement("Set WshShell=nothing");
$scripter=null;
?>


Now, if I have someprogram.exe already running, it will jump to that.
If I don't, it will open up a new instance. Great, it works. However,
the new instance is running as a SYSTEM process, and not my login name.
I trying to automate a printout, and I can't set any settings on the
printer for 'system', so it gets all funky.

I have been searching all freaking day for a solution... is there one?

PLEASE HELP :)

Re: shell.run problems :( by NY

NY
Mon Dec 11 09:31:16 CST 2006

since this is running on a windows OS, why use php at all? vbscript is built
in and you wont have all these silly problems



<psell@hotmail.com> wrote in message
news:1165622225.973242.50080@f1g2000cwa.googlegroups.com...
>I run a php script on localhost that contains vbscript in it to execute
> a program, like so:
>
> <?php
> $scripter = new COM("MSScriptControl.ScriptControl");
> $scripter->Language = "vbscript";
> $scripter->ExecuteStatement("Set WshShell =
> createobject(\"wscript.shell\")");
> $scripter->ExecuteStatement("oExec =
> WshShell.Run(\"someprogram.exe\",1,TRUE)");
> $scripter->ExecuteStatement("Set WshShell=nothing");
> $scripter=null;
> ?>
>
>
> Now, if I have someprogram.exe already running, it will jump to that.
> If I don't, it will open up a new instance. Great, it works. However,
> the new instance is running as a SYSTEM process, and not my login name.
> I trying to automate a printout, and I can't set any settings on the
> printer for 'system', so it gets all funky.
>
> I have been searching all freaking day for a solution... is there one?
>
> PLEASE HELP :)
>