China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-03 18:19
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Does batch processing have this function? Send the local machine's IP to a specified email View 2,473 Replies 25
Original Poster Posted 2006-06-08 14:46 ·  中国 广东 深圳 电信
初级用户
Credits 117
Posts 37
Joined 2006-06-08 12:23
20-year member
UID 56740
Status Offline
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?
Floor 2 Posted 2006-06-08 14:54 ·  中国 江苏 苏州 电信
中级用户
★★
过度热情
Credits 321
Posts 139
Joined 2006-03-21 17:19
20-year member
UID 52521
Gender Male
Status Offline
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.
Floor 3 Posted 2006-06-08 17:06 ·  中国 广东 深圳 电信
初级用户
Credits 117
Posts 37
Joined 2006-06-08 12:23
20-year member
UID 56740
Status Offline
Who knows exactly how to write it?
Floor 4 Posted 2006-06-08 17:17 ·  中国 北京 联通
银牌会员
★★★
DOS联盟捡破烂的
Credits 1,144
Posts 425
Joined 2005-10-20 00:00
20-year member
UID 43784
From 北京
Status Offline
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!!!!!! "
Floor 5 Posted 2006-06-08 17:35 ·  中国 广东 深圳 电信
初级用户
Credits 117
Posts 37
Joined 2006-06-08 12:23
20-year member
UID 56740
Status Offline
Thanks to the person above, but I'm a newbie. How to write a batch script?
Floor 6 Posted 2006-06-08 20:57 ·  中国 山西 临汾 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline

───────────────── 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 ]
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 7 Posted 2006-06-08 21:49 ·  中国 四川 成都 联通
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Using batch processing is feasible. Logging in to the Mail Server can use telnet ~~ but you need to thoroughly study the RFCs~~

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 8 Posted 2006-06-09 09:53 ·  中国 广东 深圳 电信
初级用户
Credits 117
Posts 37
Joined 2006-06-08 12:23
20-year member
UID 56740
Status Offline
Reply to the board moderator, I just want to use this method to manage the network, and there is absolutely no illegal intention!
Floor 9 Posted 2006-06-09 10:03 ·  中国 北京 联通
银牌会员
★★★
DOS联盟捡破烂的
Credits 1,144
Posts 425
Joined 2005-10-20 00:00
20-year member
UID 43784
From 北京
Status Offline
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
Floor 10 Posted 2006-06-09 10:47 ·  中国 四川 成都 联通
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Hehe, still VBS~~~

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 11 Posted 2006-06-09 10:56 ·  中国 北京 联通
银牌会员
★★★
DOS联盟捡破烂的
Credits 1,144
Posts 425
Joined 2005-10-20 00:00
20-year member
UID 43784
From 北京
Status Offline
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!!! .........
Floor 12 Posted 2006-06-11 20:03 ·  IANA 局域网IP(Private-Use)
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
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!

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 13 Posted 2006-06-12 10:16 ·  中国 江苏 苏州 电信
中级用户
★★
过度热情
Credits 321
Posts 139
Joined 2006-03-21 17:19
20-year member
UID 52521
Gender Male
Status Offline
CDO.Message cannot be found under winxp.?.
How to write vbs under winxp
Floor 14 Posted 2006-06-12 15:42 ·  中国 浙江 杭州 电信
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
There is a third - party tool called blat, which is used to send emails from the command line.

http://www.blat.net
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 15 Posted 2006-06-12 18:26 ·  中国 福建 泉州 电信
高级用户
★★
论坛灌水专业户
Credits 613
Posts 266
Joined 2006-04-19 22:47
20-year member
UID 54113
From 河南省
Status Offline
Hehe, after looking at it for a long time, my eyes hurt, still don't understand~

.....................
饮马恒河畔,剑指天山西,碎叶城揽月,库叶岛赏雪,黑海之滨垂钓,贝尔加湖面张弓;中南半岛访古,东京废墟祭祖!
Forum Jump: