Turn on a remote computer from power-off state.  Computer must be WOL enabled.  
Supported in windows console version 2.35 and later.  Not the free DOS version.
 

    ************************************************************************
    * Program: WakeOnLan.q                                                 *
    * Syntax.: QUIKCODE WAKEONLAN.Q <ENTER>                                *
    * Purpose: Wakes up a remote computer in a power-off state by sending  *
    *          a 102 byte UDP packet to a network broadcast address using  *
    *          port 9.  Known as a "Magic Packet".                         *
    * Notes..: The remote computer must have an ethernet device that is    *
    *          wake-on-lan (WOL) enabled and attached to a network.  To    *
    *          obtain the physical (MAC) address of a computer, enter the  *
    *          following from a command prompt: ipconfig /all  <ENTER>     *
    ************************************************************************
 
    equate BCASTADDR     to '192.168.1.255'  * <- Change to your network broadcast address
    equate MACADDR       to x'00504C057D04'  * <- Change to your ethernet card MAC address
 
    equate cnt           to wst110-111   * Counter 
    equate sub           to wst112-114   * Subscript
    open csa BCASTADDR ':9' UDP 102      * Open Client Socket A (CSA) area, UDP Port 9  
    move 1               to cnt          * Initialize counter  
    move 1               to sub          * Initialize subscript
    move x'FFFFFFFFFFFF' to csa1-6       * Magic packet begins with 6 x'FF's
100 if cnt > 16                          * Copied MAC Address 16 times? 
      write csa                          * Write magic-packet         
      sleep 250                          * Sleep 1/4 second    
      write csa                          * UDP not guaranteed, send another packet.   
      end.                               * End this program
    move MACADDR         to csa7(sub)    * Remote ethernet card MAC address
    add 1 to cnt                         * Bump counter up by 1
    add 6 to sub                         * Point to next location to store MAC address
    go to 100                            * Go copy MAC address again
 

 

Back to homeBack to home