Working on windows platform, I have a python application which once invoked, remembers its state and resumes in case of system crash or reboot. The application actually runs some other executables or in technological terms is of type framework. The typical scenario where the executable need to run with admin mode passes for first time but fails after resuming from crash or reboot. What I believe is I need to invoke the resumed application with admin mode. In what way this could be achieved, Thanks in advance!
Asked
Active
Viewed 444 times
1
-
2What OS? Typically under *nix, you'd just use `sudo`. – mgilson Nov 05 '13 at 05:43
-
if linux, you can do it with `sudo` . but if you need to run it automatically after restart, you should add command to `startup programs` . And also you need to add certain lines to `sudores` file also to ignore the password asking while autorun. – Janith Chinthana Nov 05 '13 at 05:55
-
Thanks. Actually its on windows...Sorry didn't mention nitially – AbdulMumin GTechEnthusiast Nov 05 '13 at 06:15
-
[Following this answer](http://stackoverflow.com/questions/195109/running-compiled-python-py2exe-as-administrator-in-vista/1445547#1445547) you create a .exe from the .py script using py2exe and using an flag called 'uac_info' it's pretty neat solution – shad0w_wa1k3r Nov 05 '13 at 06:24
-
Possible duplicate - http://stackoverflow.com/questions/130763/request-uac-elevation-from-within-a-python-script – shad0w_wa1k3r Nov 05 '13 at 06:26
1 Answers
0
For Linux, see documentation on upstart
(for Ubuntu) or service
(for RedHat). The write a start-up script to start your Python script with appropriate rights. You can also configure it to be restarted if it crashes.
Windows has a similar facility for start-up programs, where you can register your program to start.

Alexander L. Belikoff
- 5,698
- 1
- 25
- 31
-
1Great, so every time the question is edited we will be downvoting the answers? – Alexander L. Belikoff Nov 05 '13 at 06:18
-
Ok, for windows registration at startup enables to resume the application but not with admin mode as against the application was invoked with admin privileges. Any way out? – AbdulMumin GTechEnthusiast Nov 05 '13 at 06:18
-
The downvote & comment was just to notify you. I was going to remove it in 5 minutes. – shad0w_wa1k3r Nov 05 '13 at 06:19
-
1sorry for the inconvenience guys, Will take care next time! – AbdulMumin GTechEnthusiast Nov 05 '13 at 06:20