Preparations
- For the first time setup, it is recommended to directly connect the host PC and the remote system with a ethernet cable, rather than through a router or other medium (such as WiFi).
- This action is to ensure that the connection won't be affected by network firewall or other settings.
- The third-party software Putty is used in this demo, but user can choose other third-party softwares to access shell.
Part 1 Test Putty Shutdown Command
- For the first time access, the following dialog box will appear, please select Accept.
- Otherwise, the executable file .EXE won't be able to run the shutdown command and an error will occur.

- Enter the command /sbin/shutdown -P -h now to shut down the remote system.
Part 2 Generate Executable Files .EXE
- LabVIEW is used in the demo, but user can choose other programming languages (such as C, C++).
- After changing the username and IP address in the source code, generate the executable file.
Part 3 Set The Executable File To Run After Logout Windows User
- Press the Windows + R keys, enter gpedit.msc and click Run.
- Select User Configuration >> Windows Settings >> Scripts (Logon/Logoff)
- Under the Logoff Properties window, select Add >> Browse to add the executable file.
- Click OK
- Click Apply and then click OK
-

- Log out of Windows, Windows will automatically run the selected executable file before logging out.
- At this time, the remote system will also be shut down.
- However, the time to log out of Windows will be longer (about 5 minutes). The actual time taken will depend on the performance of the computer.
- Turn off the host PC.
The reason of choosing to set the executable file to run after logout instead of before shutdown is the network card may be powered off immediately after the host PC is shut down, so it may not have enough time to send the shutdown command to the remote system.