Shoutbox

Require admin rights in a C program - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Require admin rights in a C program (/showthread.php?tid=88598)

Require admin rights in a C program by Chancer on 01-20-2009 at 10:55 PM

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?


RE: Require admin rights in a C program by tony on 01-20-2009 at 11:19 PM

Something like this?

http://shoutbox.menthix.net/showthread.php?tid=88474


RE: Require admin rights in a C program by Chancer on 01-20-2009 at 11:25 PM

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.


RE: RE: Require admin rights in a C program by djdannyp on 01-21-2009 at 08:52 AM

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
RE: Require admin rights in a C program by Chancer on 01-21-2009 at 05:44 PM

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|


RE: RE: Require admin rights in a C program by djdannyp on 01-21-2009 at 10:53 PM

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?
RE: Require admin rights in a C program by Chancer on 01-21-2009 at 11:41 PM

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.