Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,
I am passing command line arguments from one process to another process using shellexecute().
In windows 7 i am getting a UAC prompt, in that prompt these command line arguments are seen,but i dont want these arguments to be seen.

I am running this as run as administrator.

example:
This is my sample code.
HINSTANCE hi = ShellExecute(NULL,_T("open"),path of exe to be invoked,commandline argumets to be passed,NULL,SW_SHOW);
Posted
Updated 27-Sep-11 1:46am
v7
Comments
TRK3 26-Sep-11 16:27pm    
I don't think you are going to be able to do that.

I certainly would hope that Windows doesn't give you a way to do that. The whole point of UAC is to let the user know exactly what program is trying to do what -- the command line arguments to the program are vital data the user should have available in order to be able to make an informed decision about saying OK or not.

If you wrote both processes, you could pass the arguments in shared memory, in a file or via named pipes...
Sergey Alexandrovich Kryukov 3-Oct-11 1:34am    
Agree.
Better yet, OP shouldn't use two processes if the source code of both is accessible. Why having isolated processes and then design a hole in isolation. One single process is always better, but what was the child process should become a DLL with some entry point which could be called in a separate thread, in case any kind of parallelism is really needed.
OP should share the ultimate goal of this activity to get a reasonable advice.
--SA

You need to embed a manifest file that indicates your application needs administrative access.

Here is a link that describes the details:

http://blogs.msdn.com/b/heaths/archive/2006/09/26/custom-actions-under-uac-in-vista.aspx[^]

When your second application is started by an application that already has elevated privileges, the prompt will not appear.
 
Share this answer
 
if it is you app your starting you can add some internal handling of options.

If you start an external programm that UAC works as designed. And very fine.

Guess that you are doing some bad stuff?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900