What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Require admin rights in a C program

Require admin rights in a C program
Author: Message:
Chancer
Senior Member
****

Avatar

Posts: 648
Reputation: 7
34 / Male / Flag
Joined: May 2005
Status: Away
O.P. Require admin rights in a C program
I'm making a "stupid" program that cleans the print spooler. However, the commands mus be executed with admin rights.

How can I force the program to run with admin rights?
01-20-2009 10:55 PM
Profile E-Mail PM Find Quote Report
tony
Senior Member
****

Avatar

Posts: 976
Reputation: 54
35 / Male / Flag
Joined: Jul 2004
RE: Require admin rights in a C program
Something like this?

http://shoutbox.menthix.net/showthread.php?tid=88474
[Image: beginnerbadgeef2.gif][Image: danceichigoow9.gif]
01-20-2009 11:19 PM
Profile PM Web Find Quote Report
Chancer
Senior Member
****

Avatar

Posts: 648
Reputation: 7
34 / Male / Flag
Joined: May 2005
Status: Away
O.P. RE: Require admin rights in a C program
I remember passing thru that thread a few days ago.
But that's too complex for me :P
I'm making a simple program, no graphic interface, a single .c file...
I have no idea about what a manifest file is.

This post was edited on 01-20-2009 at 11:26 PM by Chancer.
01-20-2009 11:25 PM
Profile E-Mail PM Find Quote Report
djdannyp
Elite Member
*****

Avatar
Danny <3 Sarah

Posts: 3546
Reputation: 31
37 / Male / Flag
Joined: Mar 2006
RE: RE: Require admin rights in a C program
quote:
Originally posted by Chancer
I remember passing thru that thread a few days ago.
But that's too complex for me :P
I'm making a simple program, no graphic interface, a single .c file...
I have no idea about what a manifest file is.

The manifest file is what you need to require admin rights :P

It's only used in compiling the program, it's not a seperate file that has to be used/distributed with the program
[Image: 1ftt0hpk-signature.png]
AutoStatus Script || Facebook Status Script
5157 days, 8 hours, 23 minutes, 47 seconds ago
01-21-2009 08:52 AM
Profile E-Mail PM Find Quote Report
Chancer
Senior Member
****

Avatar

Posts: 648
Reputation: 7
34 / Male / Flag
Joined: May 2005
Status: Away
O.P. RE: Require admin rights in a C program
Do I have to install Visual Studio do to that?

Because I'm making a 20 line console program (which 4 are real commands, others are a simple text-interface). I don't think it'd worth...

Edit: I've just accidentally deleted the source code 8o|

This post was edited on 01-21-2009 at 05:45 PM by Chancer.
01-21-2009 05:44 PM
Profile E-Mail PM Find Quote Report
djdannyp
Elite Member
*****

Avatar
Danny <3 Sarah

Posts: 3546
Reputation: 31
37 / Male / Flag
Joined: Mar 2006
RE: RE: Require admin rights in a C program
quote:
Originally posted by Chancer
Do I have to install Visual Studio do to that?

Because I'm making a 20 line console program (which 4 are real commands, others are a simple text-interface). I don't think it'd worth...

Edit: I've just accidentally deleted the source code 8o|

If you do re-discover your source code, then the only way without visual studio (that i know of) is to right click on the program and do "run as administrator".....or go to its compatibility tab and check the 'run as administrator' box.

what are you using to compile it if not visual studio?
[Image: 1ftt0hpk-signature.png]
AutoStatus Script || Facebook Status Script
5157 days, 8 hours, 23 minutes, 47 seconds ago
01-21-2009 10:53 PM
Profile E-Mail PM Find Quote Report
Chancer
Senior Member
****

Avatar

Posts: 648
Reputation: 7
34 / Male / Flag
Joined: May 2005
Status: Away
O.P. RE: Require admin rights in a C program
I'm using Dev-Cpp, which uses GCC. It's very simple. I used to do college stuff.

quote:
or go to its compatibility tab and check the 'run as administrator' box
That's the alternative I'm using.

This post was edited on 01-21-2009 at 11:44 PM by Chancer.
01-21-2009 11:41 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On