auto run of *.exe's when power up&down?

G

Guest

I have two *.exe's I want the PC to run automatically. One executes when the
PC is turned on or comes out of standby. The second executes when the PC is
turned off or put into standby. Any white papers or how-to instructions?

My *.exe's send commands out of the COM2/RS232 port. I have a peripheral
attached to the RS232 that I want to turn off&on when the PC power
transistions.

Mike.
 
A

a nonymous

| I have two *.exe's I want the PC to run automatically. One executes when the
| PC is turned on or comes out of standby. The second executes when the PC is
| turned off or put into standby. Any white papers or how-to instructions?
|
| My *.exe's send commands out of the COM2/RS232 port. I have a peripheral
| attached to the RS232 that I want to turn off&on when the PC power
| transistions.

Mike,

XP Pro can easily be configured to run scripts at Startup and Shutdown.
I do not know about running scripts when going into, or coming out of Standby.

What about hardware control? Is the peripheral able to sense the
DataSet Ready or Carrier Detect or Clear To Send levels?
 
G

Guest

The HW control of the peripheral is very simple: RS232 with Tx,Rx&GND only --
it has none of the other control signals in the RS232 spec. I put the PC COM
port into a standard Null configuration.

If you have a link on embedding exe's to run at power up and down, could you
pass me a URL? (p.s. I'm not looking to run scripts, to me that implies
something like Java or Perl, I want to run compiled exe's).

Mike.
 
A

a nonymous

| I have two *.exe's I want the PC to run automatically. One executes when the
| PC is turned on or comes out of standby. The second executes when the PC is
| turned off or put into standby. Any white papers or how-to instructions?
|
| My *.exe's send commands out of the COM2/RS232 port. I have a peripheral
| attached to the RS232 that I want to turn off&on when the PC power
| transistions.

| "a nonymous" wrote:
| XP Pro can easily be configured to run scripts at Startup and Shutdown.
| I do not know about running scripts when going into, or coming out of Standby.
|
| What about hardware control? Is the peripheral able to sense the
| DataSet Ready or Carrier Detect or Clear To Send levels?

| The HW control of the peripheral is very simple: RS232 with Tx,Rx&GND only --
| it has none of the other control signals in the RS232 spec. I put the PC COM
| port into a standard Null configuration.
|
| If you have a link on embedding exe's to run at power up and down, could you
| pass me a URL? (p.s. I'm not looking to run scripts, to me that implies
| something like Java or Perl, I want to run compiled exe's).


For XP Pro, not on a domain:

1) In a text editor (such as Notepad), create the script to launch your
StartUp-Shutdown.EXE, e.g.,

Path\to\StartUp-Shutdown.EXE

- Save it in a folder of your choice or the Default Folder:
C:\WINDOWS\system32\GroupPolicy\User\Scripts\Logon

+ With a .BAT extension as a batch file
e.g., StartUp-Shutdown.BAT

2)
Start
Help and Support
STARTUP SCRIPT

Full-text Search Matches (11 results)

1. Assign computer startup scripts
2. Assign computer shutdown scripts
6. Scripts
9. Order of events in startup and logon
 
G

Guest

Thanks, you've helped to give me some insight in to the terminology used by
MSFT, and to dig deeper. Here's a "tool" I found for managing logon&logoff
scripts from a common point:

Start -> Run -> gpedit.msc -> Ok
Local Computer Policy -> Computer Configuration -> Windows Settings ->
Scripts (Startup/Shutdown)

You'll see what's going on once you get into the Scripts(Startup/Shutdown)
console. I'll play around with this.

Mike.
 
D

David Candy

If you actually want to do what you asked then you need to write a program. Windows tells all programs "I'm about to sleep is that ok with you?" and "I've just woken do you care?" It would be a fairly simple program of a few lines.


Platform SDK: Hardware

WM_POWERBROADCAST Messages
The system broadcasts a message to all applications and installable drivers whenever a power management event occurs or whenever an application calls the SetSystemPowerState function to suspend operation. The system broadcasts these events through the WM_POWERBROADCAST message, setting the wParam parameter to the appropriate power management event. For example, the PBT_APMPOWERSTATUSCHANGE event indicates a system power status change. You must ensure that your application responds to the WM_POWERBROADCAST message to properly stop activity when the system enters the sleeping state and to recover transparently when the system enters the working state. When the system enters the sleeping state, it closes network connections. The user can change the hardware configuration or power supply while the system is in the sleeping state.

The system broadcasts a PBT_APMQUERYSUSPEND event to request permission to suspend system operation. The system expects each application and driver to determine whether the requested event should occur and to return TRUE if it occurs, or return BROADCAST_QUERY_DENY otherwise. Any application or driver can deny the request and prevent the event from occurring.

The system broadcasts a PBT_APMSUSPEND event immediately before suspending operation. This gives applications and drivers one last chance to prepare for the event. In many cases, the system broadcasts these messages without requesting permission to do so. This happens, for example, if an application forces suspension with the SetSystemPowerState function.

The system broadcasts the PBT_APMQUERYSUSPENDFAILED event whenever a requested event is denied. These events notify applications and drivers to continue operation as usual.

The system broadcasts the PBT_APMRESUMESUSPEND or PBT_APMRESUMECRITICAL event when system operation has been restored. If an application received a PBT_APMSUSPEND event before the computer was suspended, it will receive the PBT_APMRESUMESUSPEND event. Otherwise, it will receive the PBT_APMRESUMECRITICAL event.


Platform SDK Release: August 2001 What did you think of this topic?
Let us know. Order a Platform SDK CD Online
(U.S/Canada) (International)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top