中国DOS联盟论坛

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-03 18:18
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » Does batch processing have this function? Send the local machine's IP to a specified email
Printable Version  2,471 / 25
Floor1 nblue Posted 2006-06-08 14:46
初级用户 Posts 37 Credits 117
Does batch processing have this function?
After running this batch processing, the local IP will be sent to the specified email. If the local machine is not connected to the network, there will be no error prompts and no sending.
I wonder if my this idea can be realized?
Floor2 piziliu2004 Posted 2006-06-08 14:54
中级用户 Posts 139 Credits 321
Okay.! Used it once a long time ago.! Now I don't remember.! I just know there is a command for email sending and receiving. Followed by the specified email address, and the content is okay.
Floor3 nblue Posted 2006-06-08 17:06
初级用户 Posts 37 Credits 117
Who knows exactly how to write it?
Floor4 bagpipe Posted 2006-06-08 17:17
银牌会员 Posts 425 Credits 1,144 From 北京
I just think that batch processing alone seems not to work to solve this problem. Except for third-party tools, but it can be realized by combining batch processing + VBS script. I will give you the code of the VBS script to send emails. You can use it in combination with batch processing. The code is as follows

NameSpace="http://schemas.microsoft.com/cdo/configuration/"
Set Email=CreateObject("CDO.Message")
Email.From="bwli@ql-art.com"
Email.To="bagpipe737@163.com"
Email.Subject="I'm just trying it out"
Email.Textbody="OK!"
Email.AddAttachment "C:\gp.rar"
With Email.Configuration.Fields
.Item(NameSpace&"sendusing")=2
.Item(NameSpace&"smtpserver")="mail.ql-art.com"
.Item(NameSpace&"smtpserverport")=25
.Item(NameSpace&"smtpauthenticate")=1
.Item(NameSpace&"sendusername")="xxx"
.Item(NameSpace&"sendpassword")="xxx"
.Update
End With
Email.Send
wscript.echo "Send Finish!!!!!! "
Floor5 nblue Posted 2006-06-08 17:35
初级用户 Posts 37 Credits 117
Thanks to the person above, but I'm a newbie. How to write a batch script?
Floor6 willsort Posted 2006-06-08 20:57
元老会员 Posts 1,512 Credits 4,432

───────────────── Moderator Notice ─────────────────
Please be aware that the issues you mentioned involve certain sensitive or potentially harmful technical information.
If you cannot prove the legitimacy and legality of obtaining such information within one day,
The moderator of this forum has the right to take some effective shielding measures on your questions and related replies.
───────────────── Moderator Notice ─────────────────


[ Last edited by willsort on 2006-6-8 at 21:00 ]
Floor7 electronixtar Posted 2006-06-08 21:49
铂金会员 Posts 2,672 Credits 7,493
Using batch processing is feasible. Logging in to the Mail Server can use telnet ~~ but you need to thoroughly study the RFCs~~
Floor8 nblue Posted 2006-06-09 09:53
初级用户 Posts 37 Credits 117
Reply to the board moderator, I just want to use this method to manage the network, and there is absolutely no illegal intention!
Floor9 bagpipe Posted 2006-06-09 10:03
银牌会员 Posts 425 Credits 1,144 From 北京
WINDOWS 2000 passed the test, not applicable to 98 system

@echo off
for /f "tokens=2 delims=:" %%i in ('"ipconfig|findstr /I /c:"ip address""') do set a=%%i

echo NameSpace="http://schemas.microsoft.com/cdo/configuration/" >1.vbs
echo Set Email=CreateObject("CDO.Message") >>1.vbs
echo Email.From="Your sending email address" >>1.vbs
echo Email.To="Your receiving email address" >>1.vbs
echo Email.Subject="TEST" >>1.vbs
echo Email.Textbody="%a%" >>1.vbs
echo With Email.Configuration.Fields >>1.vbs
echo ^.Item(NameSpace^&"sendusing")=2 >>1.vbs
echo ^.Item(NameSpace^&"smtpserver")="SMTP address" >>1.vbs
echo ^.Item(NameSpace^&"smtpserverport")=25 >>1.vbs
echo ^.Item(NameSpace^&"smtpauthenticate")=1 >>1.vbs
echo ^.Item(NameSpace^&"sendusername")="Username" >>1.vbs
echo ^.Item(NameSpace^&"sendpassword")="Password" >>1.vbs
echo ^.Update >>1.vbs
echo End With >>1.vbs
echo Email.Send >>1.vbs

cscript c:\1.vbs
del c:\1.vbs
Floor10 electronixtar Posted 2006-06-09 10:47
铂金会员 Posts 2,672 Credits 7,493
Hehe, still VBS~~~
Floor11 bagpipe Posted 2006-06-09 10:56
银牌会员 Posts 425 Credits 1,144 From 北京
electronixtar Haha, it's estimated that after you post a few more threads, you'll be able to get the title of "Silver Member". Envious!!! .........
Floor12 electronixtar Posted 2006-06-11 20:03
铂金会员 Posts 2,672 Credits 7,493
Sweat~~~Most of the posts are water, and the level qualifications are just filling numbers. In fact, I should envy you, your posts are numerous and of high quality!
Floor13 piziliu2004 Posted 2006-06-12 10:16
中级用户 Posts 139 Credits 321
CDO.Message cannot be found under winxp.?.
How to write vbs under winxp
Floor14 Climbing Posted 2006-06-12 15:42
铂金会员 Posts 2,753 Credits 6,962 From 河北保定
There is a third - party tool called blat, which is used to send emails from the command line.

http://www.blat.net
Floor15 chineselgs Posted 2006-06-12 18:26
高级用户 Posts 266 Credits 613 From 河南省
Hehe, after looking at it for a long time, my eyes hurt, still don't understand~

.....................
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023