Click here to Skip to main content
15,886,731 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I created an application which simply runs system command for running MS script file with cscript.exe

For example,

C++
cscript.exe c:\test.js /param1 /param2


What my application does is just running system commands. If I log in with Super Administrator account, which has highest previlleges in windows 7 accounts, UAC warning does not pop up. But if I log in with any other account, UAC warning shows up when I run my application.

I haven't changed my UAC level of Windows system. (It is Default level now).

I tried to google solutions for these, but had no luck. Could anyone help me figure out this issue?

Thanks,
Paul.
Posted
Comments
jkirkerx 18-Mar-13 19:43pm    
That's what it's suppose to do. It's there to protect your PC from unwanted programs running without your knowledge. In the long run, if the program is for unattended production use, you should not disable it.

When not running as a real administrator, your running a virtual windows using Vista and Windows 7.
The real windows is 2 levels up from that. The virtual windows can only read and write to a couple of places on the hard drive, and can only run programs within itself.

When you elevate, the screen sort of blanks out and a new screen appears that looks the same, now your not running in the virtual windows anymore, and can access more of the hard drive, and run that external program.

There's one more level above that, that's like running XP as administrator with full control.

For me, after messing with UAC for about a year, reading hundreds of articles on it, I determined to just play nice with it, and to use the UAC prompt.

So you call the prompt, and it the user accepts, you can run that external program, if not, the program won't do that feature.

You have to design your program in advance, with UAC in mind, and perhaps rewrite that script if possible to play nice at the lowest level.

http://en.wikipedia.org/wiki/User_Account_Control[UAC ^]

[edit]
I didn't see that your from China, and are not interested in the protection of your PC.
just joking
bbirajdar 20-Mar-13 8:33am    
This is the solution.... My +5..Please post it as a solution... I want to vote

[Edit] I take jokes seriously :|

1 solution

To completely bypass this warning and still run programs as an administrator, do the following:-

1) Start, Run, secpol.msc
2) Click on Local Policies, Security Options
3) Scroll down to this setting: "User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode."
4) Change the setting to "Elevate Without Prompting"

Or You can try below Link :-
http://www.howtogeek.com/howto/4820/how-to-really-completely-disable-uac-on-windows-7[^]
 
Share this answer
 
v2
Comments
bbirajdar 18-Mar-13 9:00am    
Correct solution.. +5 .. But the OP will not love to follow this procedure I guess...
Paul Zheng 20-Mar-13 7:31am    
Thank you for your suggestion, but I have to prevent UAC warning without changing security options like that.
bbirajdar 20-Mar-13 8:36am    
See the comment above by jkirkerx .... That's the alternative solution.

You want your program to bypass the security system in the Operating System..It is not that easy as you think.. Microsoft says it is impossible..If you can do it by any any any way,just show it to Microsoft , they will pay you your 5 years salary...

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