PC Review


Reply
Thread Tools Rate Thread

CreateProcessWithLogonW And RunAS

 
 
Wayne Gibson
Guest
Posts: n/a
 
      16th Oct 2003
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


 
Reply With Quote
 
 
 
 
Stoyan Damov
Guest
Posts: n/a
 
      16th Oct 2003
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
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
runas /user:USER problem and a strange behavior of runas Stefan Helmig Windows Vista Administration 1 31st Jan 2007 06:51 PM
CreateProcessWithLogonW =?Utf-8?B?VG9kZCBC?= Microsoft ASP .NET 0 1st Aug 2005 04:28 PM
CreateProcessWithLogonW Bilal Dinc Microsoft C# .NET 3 20th Jan 2004 10:06 PM
CreateProcessWithLogonW And RunAS Wayne Gibson Microsoft Dot NET Framework Forms 4 17th Oct 2003 02:54 PM
CreateProcessWithLogonW And RunAS Wayne Gibson Microsoft Windows 2000 Security 1 16th Oct 2003 04:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:45 AM.