shutdown or reboot computer

Ask a Question related to PERL Miscellaneous, Design and Development.

  1. #1

    Default shutdown or reboot computer

    Hello,

    how can I reboot, shutdown(PowerOff) or change the user with a Perl Script ?


    Jochen Friedmann Guest

  2. Similar Questions and Discussions

    1. Flash makes my computer reboot!!
      I've already posted a thread on this and got no reply. Any site I go to involving flash reboots my computer. Not instantly. If there are several ads...
    2. Remote shutdown not working if the computer is locked
      One of the MS KB explains that it is a bug in Windows 2000 server, but it was corrected in SP3. But this problem exists in Windows 2003 std server....
    3. reboot pc with PHP
      Hi List I've gone through the list for previous questions and the only one that seems to be a solution is to use sudo, however, I cannot seem to...
    4. [PHP] reboot pc with PHP
      A more easy solution is that: Make a cron that executes every minut /tmp/rreboot.sh for user root crontab -e Add the line: * * * * * ...
    5. Access entire desktop computer from laptop computer on wireless network
      When I try to set up a network place on my laptop, I browse the locations that I want to setup in the network place set-up wizard but it wont let...
  3. #2

    Default Re: shutdown or reboot computer

    Jochen Friedmann <jochen.friedmann2@de.bosch.com> wrote in comp.lang.perl.misc:
    > Hello,
    >
    > how can I reboot, shutdown(PowerOff) or change the user with a Perl Script ?
    First answer the question how to reboot, shut down, or change the user
    by any any means in your OS. Then ask yourself how to do the same things
    in Perl.

    Anno
    Anno Siegel Guest

  4. #3

    Default Re: shutdown or reboot computer

    Oh, sorry

    the OS is Win2000 or WinnNT

    "Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
    news:bk478o$lt4$2@mamenchi.zrz.TU-Berlin.DE...
    > Jochen Friedmann <jochen.friedmann2@de.bosch.com> wrote in
    comp.lang.perl.misc:
    > > Hello,
    > >
    > > how can I reboot, shutdown(PowerOff) or change the user with a Perl
    Script ?
    >
    > First answer the question how to reboot, shut down, or change the user
    > by any any means in your OS. Then ask yourself how to do the same things
    > in Perl.
    >
    > Anno

    Jochen Friedmann Guest

  5. #4

    Default Re: shutdown or reboot computer


    [Please don't top-post. Thanks]


    Jochen Friedmann wrote:
    > "Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
    > news:bk478o$lt4$2@mamenchi.zrz.TU-Berlin.DE...
    >> Jochen Friedmann <jochen.friedmann2@de.bosch.com> wrote in
    > comp.lang.perl.misc:
    >> > Hello,
    >> >
    >> > how can I reboot, shutdown(PowerOff) or change the user with a Perl
    > Script ?
    >>
    >> First answer the question how to reboot, shut down, or change the
    >> user by any any means in your OS. Then ask yourself how to do the
    >> same things in Perl.
    >
    >
    > Oh, sorry
    >
    > the OS is Win2000 or WinnNT

    I think you misunderstood. This isn't a Perl question until you find out
    (and tell us) how to achieve by other means what you're trying to achieve
    with Perl. And no, by "other means" I don't mean pressing the power button.

    :-)


    --
    Cheers,
    Bernard
    --
    echo 42|perl -pe '$#="Just another Perl hacker,"'

    Bernard El-Hagin Guest

  6. #5

    Default Re: shutdown or reboot computer

    Jochen Friedmann wrote:
    > Hello,
    >
    > how can I reboot, shutdown(PowerOff) or change the user with a Perl Script ?
    >
    >
    Please read the posting guidelines under what you 'Really Really Should'
    do before posting - you may find your answer quicker that way:

    [url]http://mail.augustmail.com/~tadmc/clpmisc.shtml[/url]

    Google search in comp.lang.perl.misc for 'windows shutdown' group (2nd
    match) turns up the following (may be wrapped):

    [url]http://groups.google.com/groups?q=windows+shutdown+group:comp.lang.perl.mis c&hl=en&lr=&ie=UTF-8&group=comp.lang.perl.misc&selm=E16x2.3175%24lx.1 210%40news2.giganews.com&rnum=2[/url]

    Or you could have tried 'perldoc win32' and found the Win32
    InitiateSystemShutdown() function.

    HTH - keith

    ko Guest

  7. #6

    Default Re: shutdown or reboot computer

    Jochen Friedmann wrote:
    > Hello,
    >
    > how can I reboot, shutdown(PowerOff) or change the user with a Perl Script ?
    >
    >
    system('shutdown -h now');
    system('reboot');
    system("su -l $newUser");

    Cyde Weys Guest

  8. #7

    Default Re: shutdown or reboot computer


    "Thomas Kratz" <ThomasKratz@REMOVEwebCAPS.de> wrote in news:3f65b0db.0@juno.wiesbaden.netsurf.de...
    >
    > "Jochen Friedmann" <jochen.friedmann2@de.bosch.com> wrote in news:bk48ef$e0k$1@ns2.fe.internet.bosch.com...
    > > Oh, sorry
    > >
    > > the OS is Win2000 or WinnNT
    > >
    >
    > The script below provides two functions for reboot and shutdown and should work for nt to xp.
    >
    > Thomas
    I forgot to mention, that prior to calling Reboot or Powerdown, you'll have to call AdjustToken() first and check for success. And the print statements should be removed for production :-)

    Thomas
    Thomas Kratz Guest

  9. #8

    Default Re: shutdown or reboot computer

    Jochen Friedmann (jochen.friedmann2@de.bosch.com) wrote on MMMDCLXVII
    September MCMXCIII in <URL:news:bk48ef$e0k$1@ns2.fe.internet.bosch.com >:
    __ Oh, sorry
    __
    __ the OS is Win2000 or WinnNT


    Oh, fastest way to shutdown Win2000 from Perl that I know is:

    print "\t\t\b\b\b\b\b\b\b\b\b\b\b\b" while 1;


    Although this might be fixed with some patch.


    Abigail
    --
    perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
    Abigail Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139