473,466 Members | 3,167 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using CreateProcessWithLogonW() without invoking UAC popup in Vista

Hi ,

I am trying to create process using CreateProcessWithLogonW() API.
This works fine on Win2000 and NT, but in Vista it gives a UAC popup
before the process (say, notepad, calc, etc) kicks off.

This is the sample program that I am compiling on .NET

/* START OF PROGRAM */

#define UNICODE
#define _WIN32_WINNT 0x0500
#include <userenv.h>
#include <windows.h>

void wmain(int argc, WCHAR *argv[])
{
DWORD dwFlags=0;
PROCESS_INFORMATION pi={0};
STARTUPINFOW si={0};
SecureZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
dwFlags = CREATE_UNICODE_ENVIRONMENT;
if(!CreateProcessWithLogonW(L"administrator", L"UJMO6506-2KS-5",
L"Test0000", LOGON_WITH_PROFILE, NULL, argv[1], dwFlags, NULL, NULL,
&si, &pi))
printf("\nExecuted CreateProcess with error code=[%d]",
GetLastError());
else
printf("The pid of the process=[0x%x]", pi.dwProcessId);
}

/* argv[1] is the tool that I want to run (eg: notepad) */
/* END OF PROGRAM */

Could someone please suggest me how to use this API so that I do not
get the vista UAC popup?
Disabling the UAC on the OS is not an option for me.

Many thanks in advance,
Ashish
Jun 27 '08 #1
1 4515
On Thu, 08 May 2008 01:29:32 -0700, <as*******@gmail.comwrote:
I am trying to create process using CreateProcessWithLogonW() API.
This works fine on Win2000 and NT, but in Vista it gives a UAC popup
before the process (say, notepad, calc, etc) kicks off.
What does this have to do with C#?

I don't think you can do what you want, but given that there's nothing
about the code you posted that suggests C# or .NET, this is really the
wrong newsgroup to ask.

Pete
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Arne | last post by:
Hi, I'm working on an asp.net application that reads a users username and password, and starts a process with the username read. The problem is that the program returns value...
2
by: jerry | last post by:
I'm trying to run an application under another user within a winform app writen in C#. I have tried a number of different things, but it seems that the CreateProcessWithLogonW function should work...
2
by: Bilal Dinc | last post by:
Hey, I have a question concerning the CreateProcessWithLogonW function imported from the advapi32 dll. For some reason I cant get the appName and cmdLine paramters to work together. For example,...
5
by: yk63fd01 | last post by:
hi, Is there a way to popup the balloon notifications from the systray which are so common in xp (e.g., windows messenger, usb device plug in, microsoft antispyware, etc)? I have found several...
1
by: Bucky Pollard | last post by:
I have a web service that needs to create a batch file and call it (since there are no APIs for the functionality I am looking for). I am using the Process and ProcessStartInfo objects. When I try...
10
by: David Davidson | last post by:
I am attempting to use CreateProcessWithLogonW from the server-side code of a web page (yes, I want to create a process on the server) and not having much luck. I am attempting to run VPScan, an...
6
by: Matthew Wieder | last post by:
I have an ASPNET app that is running as the ASPNET machine user. It makes a call to the API CreateProcessWithLogonW. On Windows XP it executes without a problem, but on Windows 2000, I get an...
3
by: Benjamin Bittner | last post by:
Hallo NG, I have problems with calling the CreateProcessWithLogonW() function. I tried converting an VB6 example (http://support.microsoft.com/default.aspx?scid=kb;en-us;285879) and some snippets...
2
by: None | last post by:
What's the difference between StartInteractiveClientProcess in http://msdn.microsoft.com/en-us/library/aa379608(VS.85).aspx, and CreateProcessWithLogonW?...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.