Hi,
Is "test.exe" in your executable's path. Here's (part of) the documentation
of the lpApplicationName parameter:
"The string can specify the full path and file name of the module to execute
or it can specify a partial name. In the case of a partial name, the
function uses the current drive and current directory to complete the
specification. The function will not use the search path."
Also, why don't you get the last error, or just throw "$ERR,hr" in the watch
window to see what's wrong?
HTH,
Stoyan Damov
"Wayne Gibson" <(E-Mail Removed)> wrote in message
news:bmltev$87t$1$(E-Mail Removed)...
> Hi,
> Was wondering if anybody could help..
>
> I'm try to launch an application as an administrator from with inside my
> application.
> At first this appeared to be working, until I tried launching a different
> application..
>
> I am launching the application using the following command..
>
> app = "test.exe";
> CreateProcessWithLogonW( "Administrator",".", "password",
> LOGON_WITH_PROFILE, app, null, 0, IntPtr.Zero, CurrentDirectory, ref si,
out
> pi) ;
>
> The problem is that if run the same application via the command prompt
with
> runas.exe it works!!!!
> Can see what I'm missing!!
> Anybody got any ideas?
> Are there any hidden flags for the LOGON flags..
>
> Thanks
>
> Wayne Gibson
>
>
|