This article explains how to use Windows Task Scheduler to automatically turn your TV on when a user logs into Windows, using the tv_on command included with libcec.
The batch file must work correctly when run manually before adding it to Task Scheduler. If it does not work when run by hand, it will not work when triggered at logon. Confirm the tv_on command turns your TV on successfully before proceeding.
The tv_on batch file can be found at C:\Program Files\Pulse-Eight\USB-CEC Adapter
When Windows triggers a task at logon, it fires very early in the session — often before the HDMI handshake between the PC and TV has fully completed. libcec needs the HDMI link to be active before it can send a CEC command. If the command runs too early, it finds no display and fails silently. The solution is to add a short delay, giving Windows time to establish the HDMI connection before the command fires. This article includes that delay in the setup.
Which HDMI Port Are You Using?
libcec will attempt to detect the correct HDMI port automatically. If your TV switches to the wrong input, you will need to specify the port number manually. To do this, add -s -p X to the end of the command, where X is the HDMI port number the CEC adapter is connected to — for example -s -p 3 for HDMI port 3.
If you are unsure which port is correct, try the automatic detection first and only add the port flag if the TV switches to the wrong input.
Step 1 — Locate the tv_on Command
C:\Program Files\Pulse-Eight\USB-CEC Adapteror
C:\Program Files (x86)\Pulse-Eight\USB-CEC Adapter
Step 2 — Open Task Scheduler
Step 3 — Set the Trigger
Step 4 — Set the Action
-s -p X (replacing X with your port number) into the Add arguments (optional) field.Step 5 — Finalise and Test
If Task Scheduler Is Not Right for Your Setup
CEC-Tray runs as a background application and waits for the HDMI connection to be fully ready before sending commands, making it more reliable than a fixed delay. If you are finding the Task Scheduler approach inconsistent, CEC-Tray is the recommended alternative.
CEC Adapter — How to turn your TV on when your Windows 11 PC boots using CEC-Tray
Email: cs@pulse-eight.com | Submit a support ticket
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article