bat to power on + start programs Win7 Ultimate

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
psJimm
Posts: 8
Joined: 04 Apr 2017 09:56
Contact:

bat to power on + start programs Win7 Ultimate

#1 Post by psJimm » 06 Jul 2017 02:39

Hello,

Looking for a Windows 7 batch script to do the following, same time, daily:

If HP-7700 PC is powered off then power on
Start Firefox
C:\Program Files\Mozilla Firefox\firefox.exe
Start 1x1.exe (directory player)
C:\program files\1by1\1by1.exe

Windows 7 Ultimate SP1
user: C:\users\admin

Thanks in advance!

batnoob
Posts: 56
Joined: 19 Apr 2017 12:23

Re: bat to power on + start programs Win7 Ultimate

#2 Post by batnoob » 12 Jul 2017 21:41

Pretty sure a batch file cannot run unless the computer is on.

PaperTronics
Posts: 118
Joined: 02 Apr 2017 06:11

Re: bat to power on + start programs Win7 Ultimate

#3 Post by PaperTronics » 14 Jul 2017 03:32

batnoob wrote:Pretty sure a batch file cannot run unless the computer is on.


That's obvious. That's why no one hasn't even bothered to reply to this stupid post

elzooilogico
Posts: 128
Joined: 23 May 2016 15:39
Location: Spain

Re: bat to power on + start programs Win7 Ultimate

#4 Post by elzooilogico » 14 Jul 2017 06:14

but, what if hp-7700 is another computer? it may be powered on with a WOL packet (it network card is set to allow it) that can be sent by powershell command. then, running any exe can be done through WMI, all this in a batch script. Anyway, the OP must do some homework/research.

ShadowThief
Expert
Posts: 1162
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: bat to power on + start programs Win7 Ultimate

#5 Post by ShadowThief » 14 Jul 2017 07:00

PaperTronics wrote:
batnoob wrote:Pretty sure a batch file cannot run unless the computer is on.


That's obvious. That's why no one hasn't even bothered to reply to this stupid post

Don't be a dick, the rest of the post is perfectly feasible.

macartm
Posts: 2
Joined: 12 Aug 2017 05:50

Re: bat to power on + start programs Win7 Ultimate

#6 Post by macartm » 12 Aug 2017 06:01

OK ... Well. I guess this is some kind of kiosk PC or just drives a screen display?

The first request is impossible by batch file. But you have three options.
1. Some BIOSes support setting a timed power-on. If you're lucky, you can set that there. Alternatively, if no such option exists, set it it to turn on automatically when the power goes on, and put a timer on the plug. Schedule it to automatically shut itself down with a Scheduled Task before the timer yanks the power ;)
2. If the machine runs continually, and you just want to restart it every day ... Task Scheduler. Set a scheduled task to restart.
3. If you have another computer on the same LAN that runs continually, WOL.EXE and a scheduled task to turn it on.

As for the rest of your request ... we have about 14 servers worldwide whose 'services', for ease of debugging, ran as console windows in an interactive logon. Automating startup of this was thought to be impossible, but I did it.

Here's how ... Autologons tool, set the machine to automatically log on as admin.
Create a Scheduled Task to automatically run 'At log on of admin'.
Scheduled Task points to a batch file to do what you want.

In my case the hard bit was writing the glue logic to make sure services waited for other services to start, and started in the right order ... etc.

psJimm
Posts: 8
Joined: 04 Apr 2017 09:56
Contact:

Re: bat to power on + start programs Win7 Ultimate

#7 Post by psJimm » 11 Oct 2017 06:30

macartm wrote:OK ... Well. I guess this is some kind of kiosk PC or just drives a screen display?

The first request is impossible by batch file. But you have three options.
1. Some BIOSes support setting a timed power-on. If you're lucky, you can set that there. Alternatively, if no such option exists, set it it to turn on automatically when the power goes on, and put a timer on the plug. Schedule it to automatically shut itself down with a Scheduled Task before the timer yanks the power ;)
2. If the machine runs continually, and you just want to restart it every day ... Task Scheduler. Set a scheduled task to restart.
3. If you have another computer on the same LAN that runs continually, WOL.EXE and a scheduled task to turn it on.

As for the rest of your request ... we have about 14 servers worldwide whose 'services', for ease of debugging, ran as console windows in an interactive logon. Automating startup of this was thought to be impossible, but I did it.

Here's how ... Autologons tool, set the machine to automatically log on as admin.
Create a Scheduled Task to automatically run 'At log on of admin'.
Scheduled Task points to a batch file to do what you want.

In my case the hard bit was writing the glue logic to make sure services waited for other services to start, and started in the right order ... etc.


I leave it on, 24/7, hibernate mode, wake on LAN, etc, etc, Thanks for the many additional options!

Post Reply