This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my own reference and put it on a personal site. Later, I published these pages online. Some of the pages still get used and now I want to make them available on my blog.
Photo by Tim Gouw
This step-by-step guide will show you how to create startup and shutdown scripts that will notify another PC when the target PC is turned on or off.
Create the Scripts
The first step is to create the scripts that will run when the computer is turned on or off.
Create a folder on the C:\ drive named Scripts
Open Notepad
Type @net send [IP Address] Machine started up!
Make sure to change [IP Address] to the IP address of the machine receiving the messages.
Save as C:\Scripts\startup.bat
Create a new document in Notepad
Type @net send [IP Address] Machine shut down!
Make sure to change [IP Address] to the IP address of the machine receiving the messages.
Save as C:\Scripts\shutdown.bat
You can close Notepad now
Set the Scripts to Run at Startup/Shutdown
The next step is to set those scripts to run.
Click Start > Run
Open Group Policy by typing gpedit.msc and pressing Enter
In the left pane, expand Computer Configuration > Windows Settings
Click on Scripts (Startup/Shutdown)
In the right pane, double-click on Startup
Click Add…
Click Browse…, find the file C:\Scripts\startup.bat and click Open
Click OK
Click OK once more
Now double-click Shutdown
Click Add…
Click Browse, find the file C:\Scripts\shutdown.bat and click Open
Click OK
Click OK once more
You can close Group Policy now
Turn Messenger Service On
Finally, to ensure the messages go through, the Messenger service must be running.
Click Start > Run
Type services.msc and press Enter
Find the service labeled Messenger and double-click on it
Change the Startup type to Automatic if it isn’t already
Click OK
You can close Services now