Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Greetings Fellow Monks! In a nutshell, I would like to automate placing Windows, in the case Win2000, into standby. The code I have assembled below is for automatic rebooting which works cleanly including a warning window of impending shutdown. I put this in the scheduler for unattended auto rebooting of a remote computer.
#!/usr/bin/perl -w use Win32; Win32::InitiateSystemShutdown( '', "\nWARNING\!\!\n\nSystem is about t +o Reboot\!\n\(The system will reboot in 30 seconds.\)", 30, 1, 1 );
This is what I would call it's "countermeasure" (in case you want to abort a reboot that is about to occur:
#!/usr/bin/perl -w use Win32; $machineName=""; Win32::AbortSystemShutdown($machineName);
I want to create something simliar to the first script shown above except it simply puts the computer in standby or sleep mode. I did a little digging but didn't find anything that was quite obvious right off the bat. Perhaps, maybe this falls into the realm of Windows Scripting, which I am not all that familiar with, but I am willing to adapt; hoping for a perl solution. Any help/insight that can be provided will great!
Thank you in advance for your help and wisdom in this matter!

In reply to Need Advice On Script to Automate Windows Standby by PerlBear

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-03-28 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found