1

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!

shad0w_wa1k3r
  • 12,955
  • 8
  • 67
  • 90
  • 2
    What 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 Answers1

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