Sign in to follow this  
Followers 0
tko991

Turn on Computer in Sleep Mode to run Script.

4 posts in this topic

Hi, is there a possibility for the computer to turn on itself from (stand by) mode, run some script, then go back to stand by mode, at a certain time of the day.

I've seen something like this in the form before; i tried to find it but i can't find it ^_^

any help is much appreciated :)

Share this post


Link to post
Share on other sites



The computer should be able to turn itself on at a preset time each day. Look in the BIOS settings.

Your script can run at startup and check the time of day to see if it is time to run whatever you want... then the script can end with Shutdown(32) to place the computer into standby.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

The computer should be able to turn itself on at a preset time each day. Look in the BIOS settings.

Your script can run at startup and check the time of day to see if it is time to run whatever you want... then the script can end with Shutdown(32) to place the computer into standby.

awesome, thanx for the help :)

Share this post


Link to post
Share on other sites

@all

What you can do after activating the BIOS.

Run a WOL (Wake On Lan) script. To force it to wake up.

$IPAddress = "192.168.1.255"; This is the broadcast address !
$MACAddress = "000D8787E226"


UDPStartUp()

$connexion = UDPOpen($IPAddress, 7)
$res = UDPSend($connexion, GenerateMagicPacket($MACAddress))
MsgBox(0, "", $res)

UDPCloseSocket($connexion)
UDPShutdown()


; ===================================================================
; Functions
; ===================================================================


; This function convert a MAC Address Byte (e.g. "1f") to a char
Func HexToChar($strHex)
    
    Return Chr(Dec($strHex))
    
EndFunc

; This function generate the "Magic Packet"
Func GenerateMagicPacket($strMACAddress)
    
    $MagicPacket = ""
    $MACData = ""
    
    For $p = 1 To 11 Step 2
        $MACData = $MACData & HexToChar(StringMid($strMACAddress, $p, 2))
    Next
    
    For $p = 1 To 6
        $MagicPacket = HexToChar("ff") & $MagicPacket
    Next
    
    For $p = 1 To 16
        $MagicPacket = $MagicPacket & $MACData
    Next
    
    Return $MagicPacket
    
EndFunc

regards

ptrex

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0