Link to home
Start Free TrialLog in
Avatar of DumDumBlaster
DumDumBlaster

asked on

How to make PC auto power on programatically

My old Dell Inspiron 4000 has an "auto on" mode in the BIOS, which is quite convenient. By setting a time and enabling it, you can have your computer start up every morning, say, at 7am. It starts from cold, not from sleep or hibernate, but really from completely shut down to power on and boot of windows.

Can I do that programatically with VB or API calls? Using a software that would basically set the "auto-on" time and shut down computer.

I want to stress that I'm not looking for a solution to wake from standby, which I know how already, but to really power on from a cold shut down.

Thanks
Avatar of jimbobmcgee
jimbobmcgee
Flag of United Kingdom of Great Britain and Northern Ireland image

I don't think you can do this.  When a typical machine is 'off', there is actually a small amount of power running through it from the PSU.  This is so the BIOS can acknowledge the 'soft' Power-On button and start up systems accordingly.  

I imagine your old Inspiron also channelled that power to a small BIOS program that polled the system clock and initiated a power on command.

Unless you're pretty adept at BIOS programming/EEPROM flashing/whatever else they do in mobo labs, you're probably out of luck.

If you have a Wake-On-LAN mobo/NIC, you may be able to find a clock-style device that could plug into your Ethernet port...

HTH

J.
Buy a programmable wallplug.
A programmable wallplug is all very well but you still need to press the 'soft' Power-On button (unless it's a really old machine, with a 'hard' switch).  

You could always jump the power-on button, of course...

J.
True - I'm sure any electronics shop would be able to modify / bypass the switch to stay on.
Only problem left might be the waranty on the PC.
Avatar of DumDumBlaster
DumDumBlaster

ASKER

Well, this doesn't really help me. I needed to do it programmatically, in a software. I'm not gonna tell my users: go make yourself a bypass switch. ;-)

Thanks for your efforts guys but I guess the only answer to my question is that there is no answer...

Well, technically, you can, but not without knowing 1:  the BIOS code, including how you would either interface to it, or re-write it to include this feature, but this code is usually very proprietary, and difficult to find.  If you're fortunate enough to have an Integrated Circuit Emulator(ICE) for that particular micro, the correct version of code, (And a whole bunch of time and patience) you could do it.

However, the easiest way is probably to come up with a hardware solution.  (i.e., put a programmable bypass switch in between the power switch and the MB, then hook a serial-enabled interface board to that, connecting the serial interface to the PC's serial bus (or adapter, if you prefer) which you could then write software against to program the timing, wake_on_ping, wake_on_<<Some event>>, etc.  You'd probably have to power the device seperate from the PC, though.

Just remember,  What you're trying to do is cool, but very non-trivial.   If you figure it out,  be sure to let me know.  It sounds very kewl.

Good Luck!
Well none of that helps me do what I want. What should I do? Do I still need to award the points?
i have found this code for wake up on lan

Public Sub wake_up()
Dim data As String
Dim i As Integer
       
       data = "FFFFFFFFFFFF"
        For i = 1 To 16
        data = data & Text1.Text    'Where Text1.text = MAC Address of you lan
        Next i
        data = data + hex2ascii(data)
        Winsock1.SendData (data)
End Sub

Public Function hex2ascii(ByVal hextext As String) As String
Dim y As Integer
Dim num As String
Dim Value As String
For y = 1 To Len(hextext)
    num = Mid(hextext, y, 2)
    Value = Value & Chr(Val("&h" & num))
    y = y + 1
Next y

hex2ascii = Value
End Function
MAC Address of the lan of the computer you want to wake up.
One thing to remember about what you're trrying to do here.  Windows is NOT the BIOS.  Like jimbob said in the first response, there's a small amount of current running through the PSU but that only drives the BIOS.  It does not drive the OS(Linux, Windows, etc.).  The power needs for the BIOS are tiny compared to what the full OS uses.  Since the OS isn't running, and there's no VB runtime engine available, VB, or the Win32 API won't help you.  If you're in hibernation, that's different, but if you're at a full and complete machine stop, only part of the BIOS is acutally running.  The OS is not.  For this reason alone, I again suggest that a hardware solution is abosultely the easiest way to do this.  Any BIOS code you'll write will probably be done in assembler, or C.  DumDumBlaster, have you made any progress on what you're trying to do?  Any luck?  
Set wObj = CreateObject("ActiveXperts.WOL")

  wObj.WakeUp "00-10-4B-BA-7A-51"
  WScript.Echo "WakeUp: result = " & wObj.LastError

Module WakeOnLanDemo
    Sub Main()
      Dim objWol As ASOCKETLib.WOLClass = New ASOCKETLib.WOL()
      Dim objConstants As Constants = New Constants()
      objWol.WakeUp("00-10-4B-BA-7A-51")
      Console.WriteLine( "Result: " & objWol.LastError.ToString() )
    End Sub
  End Module
FIRST ONE IS VB C# SECOND IS VB.NET

This is VBSCRIPT



Set wObj = CreateObject("ActiveXperts.WOL")

wObj.WakeUp "00-10-4B-BA-7A-51"
WScript.Echo "WakeUp: result = " & wObj.LastError
If( wObj.LastError <> 0 ) Then
  WScript.Echo "Error " & wObj.LastError & ": " & wObj.GetErrorDescription( wObj.LastError )
End If

I assume you need some kind of .WOL file
WOL-technology would be a programming solution implimented on a different computer able to access that target computer, not the kind of programming-of-self solution anticipated.  "Can be done by really getting into the bios programming" is only valid responses, but the WOL solutions here are good ideas for alternative approaches.
ASKER CERTIFIED SOLUTION
Avatar of DarthMod
DarthMod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial