Created
March 27, 2026 00:24
-
-
Save sefgit/65207f81fde4741164859b5b22c02379 to your computer and use it in GitHub Desktop.
Post cmd status to telegram
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| SET CHATID=YOUR_CHAT_ID_NUMBER_WITH_MINUS_SIGN | |
| SET TOKEN=YOUR_TELEGRAM_BOT_TOKEN | |
| SET URL="https://api.telegram.org/bot%TOKEN%/sendMessage" | |
| rem SET URL="https://httpbin.org/anything" | |
| rem YOUR COMMAND TO EXECUTE ('qwinsta admin') | |
| FOR /F "delims=" %%I IN ('qwinsta admin') DO SET RES=%%I | |
| setlocal EnableDelayedExpansion | |
| FOR /F "delims=" %%I IN ('echo %date% %RES%') DO SET INFO=%%I | |
| FOR /F "delims=" %%I IN ('time /t') DO SET T=%%I | |
| rem ECHO '{chat_id:%CHATID%, text:"%INFO%%T%"}' | |
| curl -s -X POST %URL% -H "Content-Type: application/json" -d "{\"chat_id\":%CHATID%, \"text\":\"%INFO%%T%\"}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment