Click here to Skip to main content
11,805,266 members (51,484 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ Windows MFC security

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

For example,

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?

Posted 18-Mar-13 2:21am
jkirkerx at 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.[UAC ^]

I didn't see that your from China, and are not interested in the protection of your PC.
just joking
aspnet_regiis -i at 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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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 :-[^]
aspnet_regiis -i at 18-Mar-13 9:00am
Correct solution.. +5 .. But the OP will not love to follow this procedure I guess...
Paul Zheng at 20-Mar-13 7:31am
Thank you for your suggestion, but I have to prevent UAC warning without changing security options like that.
aspnet_regiis -i at 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)

  Print Answers RSS
0 OriginalGriff 315
1 Richard Deeming 200
2 Sergey Alexandrovich Kryukov 170
3 CPallini 160
4 CHill60 150
0 OriginalGriff 3,255
1 Maciej Los 1,990
2 KrunalRohit 1,907
3 CPallini 1,855
4 Richard MacCutchan 1,227

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 18 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100