![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-12 13:37 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS批处理 & 脚本技术(批处理室) » [Help]Controlling the computer with a mobile phone via batch processing |
| Printable Version 2,765 / 16 |
| Floor1 cjiabing | Posted 2010-02-28 21:46 |
| 新手上路 Posts 18 Credits 19 | |
|
I've always wanted to make something for interacting between a mobile phone and a computer, but I'm limited in ability. I'm posting to let everyone study together.
The general idea is like this: When I go out, I forget to turn off the computer, but I might not be home for the next three days. I want to send an instruction to the computer via the mobile phone, saying, "Computer, I'm not going home, you shut down and go to sleep." How to implement this with a batch script? Computers can communicate with each other via browsers, chat tools, etc., and mobile phones can communicate with each other via phone numbers. What way is there to communicate between a mobile phone and a computer? 1. Feixin: You can send free text messages on the computer, and you can also install Feixin on a smart phone. 2. QQ: QQ on both computers and mobile phones is already very popular. 3. Email: Now mobile phones can also easily receive emails. The above are three common communication methods between mobile phones and computers. It can be seen that there is already a basic foundation for communication between mobile phones and computers. Then, what role can our batch script play in the middle? I've found the command-line versions of Feixin, QQ, and email. The command-line version of Feixin was lost by me, and I can look for it again. The command-line version of QQ can be used, but it seems to be independent like the official version, and manual operation is required. The batch script can't "embed" into its program (maybe my ability is limited), so I can't pre-set the QQ number and password, and I can't import and export communication content. The command-line version of email I use is blat.exe, but currently I only understand sending emails, and I can't figure out how to receive emails. Using email as a medium to connect the computer and the mobile phone (smart phone), on the computer, the batch script can send emails with the cooperation of blat. For example, I send an email from the mobile phone to the computer saying "Computer, execute shutdown" - converted into code: Dear007,shutdown -s. The computer is always running a batch script specifically to monitor the email. When it receives the command "Dear007,shuodown -s", it analyzes that dear007 is the computer name and "shutdown -s" is the command to execute. After receiving the command, the batch script first automatically replies an email to the mobile phone saying "Received! Executing immediately!" and starts executing the shutdown command after one minute. The entire process requires a P to monitor the email, a P to receive and analyze the email, a P to send the email, and a P to execute the command. The P to send the email can already be implemented, but the P to receive and analyze the email I haven't figured out yet. Currently, there are no specific clues. I want to ask all the experts, how to specifically implement receiving and analyzing emails? It needs to be highly operable, and both code and tools are needed. Post some out, and everyone can complete this interesting experiment, and let the batch script also achieve intelligence!~ [ Last edited by cjiabing on 2010-2-28 at 21:49 ] |
|
| Floor2 jarry0932 | Posted 2010-03-01 00:37 |
| 初级用户 Posts 122 Credits 128 | |
|
The landlord is really too imaginative... Admire...
|
|
| Floor3 lotus516 | Posted 2010-03-01 11:24 |
| 高级用户 Posts 246 Credits 551 | |
|
Reply to the previous floor, this is completely possible!
It is better to implement with email, because it is difficult to analyze QQ and Feixin packets on the computer, while email can be implemented with subject (key words), which is easier! Coupled with remote power on and off, this is completely an intelligent computer! |
|
| Floor4 lotus516 | Posted 2010-03-01 11:37 |
| 高级用户 Posts 246 Credits 551 | |
|
First work 163 email login tool
http://www.cn-dos.net/forum/viewthread.php?tid=33023&fpage=1&highlight=%E9%82%AE%E7%AE%B1 |
|
| Floor5 cjiabing | Posted 2010-03-01 16:26 |
| 新手上路 Posts 18 Credits 19 | |
|
Just logging in to the email isn't helpful; I can't read new emails. I'm currently researching Outlook and encountered a problem, which is that it's not easy to convert htm to txt.
|
|
| Floor6 HAT | Posted 2010-03-01 21:04 |
| 版主 Posts 5,017 Credits 9,023 | |
|
Tool for converting web files to plain text: HtoX32c
http://www.cn-dos.net/forum/viewthread.php?tid=25122 |
|
| Floor7 cjiabing | Posted 2010-03-01 22:33 |
| 新手上路 Posts 18 Credits 19 | |
|
Hehe, that's too complicated. I directly findstr to the key points, and now I get the following information:
Subject: =?gb2312?B?u7bTrcq508MgT3V0bG9vayBFeHByZXNzIDY=?= Subject: =?gbk?B?u/rG98jL?= Subject: Personal Resume Account Notification Subject: =?gbk?B?xOO6w6OsztLKx8X6tKbA7Q==?= Subject: dear007:dir c:\ Subject: =?gbk?B?Y3Nib3QgZWNobyDO0srHt7S/1r6r06I=?= Subject: =?gbk?B?Y3Nib3QgY3Nib3QgZWNobyC57SUwIGNzYm90?= Subject: =?gbk?B?16q3oqO6UmU6IGRlYXIwNzogZWNobyDO0srHu/o=?= Subject: =?gbk?B?ZGVhcjA3OiBlY2hvIM7Syse7+sb3yMtkZWFyMDA3?= Need to decode with base64, haven't succeeded in using it, can the person above give a solution? |
|
| Floor8 zlsanhong | Posted 2010-03-05 23:29 |
| 新手上路 Posts 14 Credits 15 | |
|
It seems that it's probably not possible without paying. Use this one. It has this function. http://www.hzybz.com/ Go find it yourself inside
|
|
| Floor9 HAT | Posted 2010-03-05 23:45 |
| 版主 Posts 5,017 Credits 9,023 | |
|
The building host's code is almost done, why do you say it's not okay?
http://bbs.bathome.net/thread-7243-1-1.html |
|
| Floor10 zlsanhong | Posted 2010-03-07 11:30 |
| 新手上路 Posts 14 Credits 15 | |
|
Quote:
Originally posted by lxzzr at 2010-3-4 13:44 You can choose tools like IE. Can your mobile phone access the internet? Set up a small website on your own computer, and then... (I tried it with N70, and it worked pretty well...) BOSS Do you use IIS to set up the server? Then how to do it. This is the best input method... It would be best if you can use the mobile phone to send text and save it as a TXT file on the computer. In this way, set up a batch processing to run on the computer all the time. When this file is found... Haha, then handle the corresponding batch processing. Girl... The key is how to send text from the mobile phone and save it to the computer? |
|
| Floor11 mgq | Posted 2010-03-07 20:02 |
| 中级用户 Posts 103 Credits 206 From 广东 肇庆 | |
|
Actually, using QQ control is a best approach:
1. Apply for two dedicated QQs, temporarily called the master control end and the receiving end. 2. The master control end is on the mobile phone, and the receiving end is on the computer. 3. Only add each other as friends to the two QQs, and prohibit anyone else from adding as friends to avoid chaos. 4. Select "Automatically control the pop-up window when a message comes" in the general items. Principle: Run the master control end QQ on the mobile phone and the receiving end on the computer. The mobile phone sends a signal QQ message, the computer receives it and pops up a window, and maximizes it to use nircmd.exe to simulate mouse actions, copy the content of the QQ window to a TXT document, then use batch processing to read the content of the TXT, and then.... The following code can normally control KuGou Music on this machine and return the execution result to the mobile phone. Requires third-party software, cmdow.exe nircmd.exe The following code is for reference, not necessarily applicable to other machines. It's written in a mess, sorry. @echo off Setlocal EnableDelayedExpansion cmdow @ /min rem Set the QQ name of the main control end (QQ name on the mobile phone) set qq=Master Control End for /f %%i in ('cmdow /t ^|findstr /i "qq" ^|findstr /i "!qq!"') do cmdow %%i /cls :chongfu cls title Receiving mobile phone information cmdow /t |findstr /i "!qq!" >nul &&goto kongji nircmd wait 500 goto chongfu :kongji for /f %%a in ('cmdow /t ^|findstr /i "!qq!"') do cmdow %%a /act /max nircmd setcursor 500 500 nircmd sendmouse right click nircmd setcursor 510 490 nircmd sendkey a press rem Clear clipboard nircmd clipboard clear nircmd sendmouse right click nircmd sendkey c press nircmd clipboard addfile "chengshu.txt" set jcb= set tkyc= for /f "skip=3" %%a in ('type chengshu.txt ^|findstr /i /v "( http"' ) do set jcb=%%a del /q chengshu.txt set tkyc=!jcb! set tkyc=!jcb! Error, this code is not configured if /i "!jcb!" == "kg" goto kg if /i "!jcb!" == "kpl" set tkyc=!jcb! KuGou play/pause &call :chuowu &goto kpl if /i "!jcb!" == "kup" set tkyc=!jcb! KuGou previous song &call :chuowu &goto kup if /i "!jcb!" == "kdo" set tkyc=!jcb! KuGou next song &call :chuowu &goto kdo if /i "!jcb!" == "ckg" set tkyc=!jcb! End KuGou &call :chuowu &goto ckg nircmd clipboard set "!tkyc!" call :kiuy goto chongfu :kg start "" "D:\Program Files\KuGou\KuGou2010\KuGoo.exe" :kgqf cmdow |findstr /i "KuGoo">nul ||( nircmd wait 1000 goto kgqf ) nircmd clipboard set "!jcb! KuGou Music has been started" call :kiuy goto chongfu :ckg for /f %%a in ('cmdow ^|findstr /i "kugoo"') do cmdow %%a /cls goto chongfu :kpl cmdow /t |findstr /i "kugoo" >nul ||goto chongfu for /f %%a in ('cmdow /t ^|findstr /i "kugoo"') do cmdow %%a /act echo CREATEOBJECT^("WSCRIPT.SHELL"^).SENDKEYS "^"+"%%"+"{f5}" >kpl.vbs echo createobject^("scripting.filesystemobject"^).deletefile wscript.scriptfullname >>kpl.vbs start "" kpl.vbs goto chongfu :kup cmdow /t |findstr /i "kugoo" >nul ||goto chongfu for /f %%a in ('cmdow /t ^|findstr /i "kugoo"') do cmdow %%a /act echo CREATEOBJECT^("WSCRIPT.SHELL"^).SENDKEYS "^"+"%%"+"{left}" >kup.vbs echo createobject^("scripting.filesystemobject"^).deletefile wscript.scriptfullname >>kup.vbs start "" kup.vbs goto chongfu :kdo cmdow /t |findstr /i "kugoo" >nul ||goto chongfu for /f %%a in ('cmdow /t ^|findstr /i "kugoo"') do cmdow %%a /act echo CREATEOBJECT("WSCRIPT.SHELL").SENDKEYS "^"+"%%"+"{right}" >kdo.vbs echo createobject^("scripting.filesystemobject"^).deletefile wscript.scriptfullname >>kdo.vbs start "" kdo.vbs goto chongfu :chuowu nircmd clipboard set "!tkyc!" :kiuy rem The following line is the mouse position with a resolution of 1024*768, please explore others by yourself. nircmd setcursor 500 650 nircmd sendmouse right click nircmd sendkey p press nircmd sendkey enter press rem End the master control end QQ window for /f %%a in ('cmdow /t ^|findstr /i "!qq!"') do cmdow %%a /cls nircmd clipboard clear |
|
| Floor12 mgq | Posted 2010-03-07 20:09 |
| 中级用户 Posts 103 Credits 206 From 广东 肇庆 | |
|
Let's add some simple operations:
Enter the following commands in mobile QQ to control KuGou, and only one command can be entered each time. KG Start KuGou kpl KuGou play/pause kup KuGou previous song kdo KuGou next song ckg End KuGou |
|
| Floor13 000000000000000 | Posted 2010-03-07 22:49 |
| 初级用户 Posts 42 Credits 49 | |
|
Feixin Robot Realizes Command-style Interaction
http://www.hiadmin.com/?p=469 |
|
| Floor14 cjiabing | Posted 2010-03-12 02:26 |
| 新手上路 Posts 18 Credits 19 | |
Originally posted by mgq at 2010-3-7 20:09: Got it, learning from you. Unfortunately, I only know P!~ |
|
| Floor15 cjiabing | Posted 2010-03-12 02:29 |
| 新手上路 Posts 18 Credits 19 | |
|
@echo off&setlocal enabledelayedexpansion
title OE Inbox Monitoring and Subject Extraction Tool echo. echo. echo. echo OE Inbox Monitoring and Subject Extraction Tool echo Setting Options echo by cjiabing cmd@xp echo. echo. echo Time control: Set the time for the program to automatically cycle. The default is 60 (about 2 minutes). set /p timec= Time Setting: if defined timec (goto set) else (set timec=60) :set echo.&set /p email= Do you want to set automatic email sending? Default is not set. (y/n): if %email%==y (call :mail) else (set cmail=echo Not sending email) echo.&echo Execution Program: Add the program to be executed with the program. The default is to execute the inbox instruction batbot001.bat. set /p Performer= Program Setting: if defined Performer (goto set1) else (goto set2) exit :set1 setlocal enabledelayedexpansion set rdm=%random% for /f "skip=49 tokens=*" %%a in ('type %0') do echo %%a>>OETool^!rdm^!.bat echo start ^"^" batbot001^.bat>>OETool^!rdm^!.bat echo start ^"^" %Performer%>>OETool^!rdm^!.bat echo ping ^/n 5 127^.0^.1^>nul>>OETool^!rdm^!.bat echo goto ^:eof>>OETool^!rdm^!.bat echo.&echo Exit settings and start executing the program&pause>nul start "" OETool^!rdm^!.bat&exit :set2 setlocal enabledelayedexpansion set rdm=%random% for /f "skip=49 tokens=*" %%a in ('type %0') do echo %%a>>OETool^!rdm^!.bat echo start ^"^" batbot001^.bat>>OETool^!rdm^!.bat echo ping ^/n 5 127^.0^.1^>nul>>OETool^!rdm^!.bat echo goto ^:eof>>OETool^!rdm^!.bat echo.&echo Exit settings and start executing the program&pause>nul start "" OETool^!rdm^!.bat&exit set cmail=call :send echo.&echo Sending Settings: Set the program to automatically send emails. Default is not sent. set /p smtp= SMTP/POP3 (e.g.: smtp.qq.com): set /p sender= Sender email address (e.g.: cjiabing@qq.com): set /p recive= Receiver email address (e.g.: cjiabing@qq.com): set /p pword= Sender email password (e.g.: 123456): set /p subj= Email subject (e.g.: cjiabing@qq.com): set /p cont= Email content text path: (e.g.: C:\body.txt) goto :eof @echo off&setlocal enabledelayedexpansion title OEInboxtool V4.4 (General Version) :start echo. echo. echo OEInboxtool V4.4 (General Version) echo by cjiabing cmd@xp echo. echo. echo. echo ※ Requires support from third-party tools such as Outlook Express, base64, blat, etc. echo ※ Set Outlook Express mailbox to check for new emails every minute. echo ※ Send emails to Outlook Express using another mailbox according to the standard procedure. echo ※ Only recognizes the subject, does not recognize the content, and the subject has limited word count and format. echo ※ If the subject sent is "shutdown -s -t 0", it will automatically shut down your computer. echo ※ Use at your own risk, and it is prohibited to use for illegal purposes and behaviors. echo. echo. ping /n 5 127.0.1>nul call :try set jici=0 :loop set /a jici+=1 echo. echo ——Start the "!jici!th" round of tasks—— ping /n ^!timec^! 127.0.1>nul echo. call :sub echo. IF errorlevel 0 (echo ) else (echo no^!^!) echo. echo —————————————————————————————————————— if exist newitems.txt call :bbot if %jici% lss 13 goto loop taskkill /f /t /im msimn.exe ping /n 10 127.0.1>nul goto start :try echo. if exist "%ProgramFiles%\Outlook Express\msimn.exe" start /min "" "%ProgramFiles%\Outlook Express\msimn.exe" ping /n 5 127.0.1>nul echo ……Initial detection…… if not exist "%ProgramFiles%\Outlook Express\msimn.exe" echo Sorry, cannot find your Outlook Express program!&ping /n 5 127.0.1>nul&exit if not exist base64.exe echo Sorry, cannot find your base64.exe program!&ping /n 5 127.0.1>nul&exit if not exist "%USERPROFILE%\Local Settings\Application Data\Identities\{1C7149FB-17FD-4ED9-B46C-B7C800F767FF}\Microsoft\Outlook Express\Inbox.dbx" echo Sorry, cannot find the Inbox of Outlook Express!&ping /n 5 127.0.1>nul&exit IF errorlevel 0 echo ……Initial detection……ok goto :eof :sub echo. echo ……1. Extract emails…… if exist newitems.txt type newitems.txt>>Readmessageslog.txt del Inbox.dbx,firstinbox.txt,editinbox.txt,subjectr.txt,newitems.txt>nul 2>nul 1>nul if exist "%ProgramFiles%\Outlook Express\msimn.exe" start /min "" "%ProgramFiles%\Outlook Express\msimn.exe"&ping /n 30 127.0.1>nul setlocal enabledelayedexpansion for /l %%a in (1,2,10000) do ( set cmt=%%a if ^!jici^!==^!cmt^! goto cmt1 ) goto cmt2 :cmt1 taskkill /f /t /im msimn.exe ping /n 10 127.0.1>nul move "%USERPROFILE%\Local Settings\Application Data\Identities\{1C7149FB-17FD-4ED9-B46C-B7C800F767FF}\Microsoft\Outlook Express\Inbox.dbx" ^!cd^! goto cmt3 :cmt2 copy "%USERPROFILE%\Local Settings\Application Data\Identities\{1C7149FB-17FD-4ED9-B46C-B7C800F767FF}\Microsoft\Outlook Express\Inbox.dbx" ^!cd^! :cmt3 ren %cd%\Inbox.dbx firstinbox.txt for /f "tokens=*" %%a in ('type firstinbox.txt') do echo %%a>>editinbox.txt for /f "tokens=2*" %%a in ('findstr /i /b "Subject" editinbox.txt') do echo %%a %%b>>subjectr.txt del firstinbox.txt,editinbox.txt>nul 2>nul 1>nul if not exist subjectr.txt echo No emails in the inbox &goto :eof if exist subjectr.txt %cmail% cd.>mnewitems.txt findstr /v "^=?gbk?B?" subjectr.txt>>mnewitems.txt setlocal enabledelayedexpansion set numt1=0 findstr "^=?gbk?B?" subjectr.txt>nul 2>nul 1>nul &IF errorlevel 0 echo ……Extract emails……ok &goto gbkb goto :eof :gbkb echo. echo ……2. Decode emails…… if exist subjectr.txt for /f "tokens=*" %%i in ('findstr "^=?gbk?B?" subjectr.txt') do ( set /a numt1+=1 echo ^!numt1^!>nul set fjmmd=%%i&echo ^!fjmmd:~8,400^!>subjectrjm1^!numt1^!.txt base64 -d -i subjectrjm1^!numt1^!.txt -o subjectrjm2^!numt1^!.txt for /f "tokens=*" %%x in (subjectrjm2^!numt1^!.txt) do echo %%x>>mnewitems.txt del subjectrjm2^!numt1^!.txt,subjectrjm1^!numt1^!.txt ) IF errorlevel 0 (echo ……Decode emails……ok &goto old) else (echo no^!^!) if exist subjectr.txt del subjectr.txt goto :eof :old echo ……3. Organize emails…… setlocal enabledelayedexpansion cd.>newitems.txt for /f "delims=" %%a in ('sort mnewitems.txt') do ( set xav=%%a if not ^!xav^! equ ^!vbm^! echo ^!xav^!>>newitems.txt set vbm=%%a ) del mnewitems.txt IF errorlevel 0 (echo ……Organize emails……ok) else (echo ……Organize emails……no) goto :eof :send echo. echo ……4. Send emails…… echo Please set up a text file in advance, write the letter content into it, and then set the path. You can use txt passive sending, or use bat sending through commands. ::call "%ProgramFiles%\WinRAR\RAR.exe" a "%userprofile%\Desktop\123456.rar" npslist.txt pslist.txt runn.txt runr.txt cd %cd% blat -install ^!smtp^! ^!sender^! blat ^!cont^! -to ^!recive^! -u ^!sender^! -base64 -charset Gb2312 -pw ^!pword^! -subject ^!subj^! ::-attach IF errorlevel 0 (echo ……Send emails……ok) else (echo ……no) echo. ping /n 5 127.0.1>nul goto :eof :bbot echo @echo off>batbot001.bat echo echo.>>batbot001.bat echo echo ……I am the execution robot batbot001……>>batbot001.bat echo echo.>>batbot001.bat echo echo —————————————————————————————————————>>batbot001.bat for /f "tokens=*" %%a in (newitems.txt) do echo %%a>>batbot001.bat echo ping /n 10 127.0.1^>nul>>batbot001.bat echo exit>>batbot001.bat start "" batbot001.bat ping /n 5 127.0.1>nul goto :eof [ Last edited by cjiabing on 2010-3-13 at 16:40 ] |
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |