script to turn on/shut down computer

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
v0x
Newbie
Posts: 2
Joined: Tue Jan 27, 2009 12:52 am

script to turn on/shut down computer

Post by v0x » Tue Jan 27, 2009 12:57 am

hello. completely new to this forum and to macro. wanted to know if any of you seasoned pros could help a girl out :oops:

i need to run a script that will turn on and shut off my computer everyday. is there a way to do this? can you do this via macro? if you could please help i would be ever so grateful!

if this is not possible via macro, could you possibly point me in the direction i need to be headed? thanks guys...

-nico

Danish_Ken
Junior Coder
Posts: 22
Joined: Mon Sep 12, 2005 1:34 am
Location: Melbourne - Australia

Post by Danish_Ken » Tue Jan 27, 2009 3:17 am

Hmm many ways to do this, most can use built in PC (BIOS) and Windows Scheduling without having to write a macro. Really depends on what you want to trigger the start up/shutdown.

If it's time based. example Startup at 07:00 everyday 7days, and shutdown at 18:00 everyday, you could do following:

Startup:
When you switch PC on, tap the DEL and/or F1 keys to get into BIOS. Depending on the BIOS/Mother board type, you should find an option in the "Power" or "Power Management" menu to set the "System wake on alarm event" to Enable. The Date can be toggled through 1-31 and usualy 0 or Everyday for recuring. Set time as well, and hit F10 to Save & Exit.

Shutdown:
In windows (XP?) open Notepad and copy following:

Code: Select all

%windir%\system32\shutdown.exe -s -f -c "Shutdown triggered from Scheduled Task in Control Panel"
HINT1: f = forced shutdown, will kill any running apps without prompt for saving
HINT2: you can abort the shutdown by quickly running "shutdown -a"

Save as
Save as type = All Files
c:\ShutdownPC.cmd
Open Control Panel and go to Scheduled Task
Add New Task, and Browse to c:\ShutdownPC.cmd
stepping through the wizard, set it to date/time and recurrence as necessary.

Hope this works for you
Macro Scheduler since Version 5.0 - 21/10/1998

v0x
Newbie
Posts: 2
Joined: Tue Jan 27, 2009 12:52 am

Post by v0x » Tue Jan 27, 2009 11:19 pm

unfortunately i have the phoenix first bios set up on the gateway 5.5 profiles...so things are different. i should have mentioned that first. 'm sorry....that would have been perfect though.

if you have any other ideas, it would be appreciated. thank you do very much.

Danish_Ken
Junior Coder
Posts: 22
Joined: Mon Sep 12, 2005 1:34 am
Location: Melbourne - Australia

Post by Danish_Ken » Wed Jan 28, 2009 12:32 am

Not familiar with that BIOS or it's features.
You may need to explore Hibernate or Suspend as alternatives, if your BIOS doesn't support Wake on Alarm, or perhaps try Wak On LAN.

A bit to get you started:
http://en.wikipedia.org/wiki/Hibernate_(OS_feature)
http://en.wikipedia.org/wiki/Wake-on-LAN
http://en.wikipedia.org/wiki/Advanced_C ... _Interface

My good friend Google sugested:
A Desktop Shortcut to Hibernation
http://www.pcmag.com/article2/0,1759,1722381,00.asp

Windows XP Shutdown Shortcut
http://www.pcmag.com/article2/0,2817,462,00.asp
Macro Scheduler since Version 5.0 - 21/10/1998

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Jan 28, 2009 12:53 am

This article http://articles.techrepublic.com.com/51 ... 73491.html shows how to have your PC wake automatically from hibernation.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts