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 17:11
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Does batch processing have this function? Send the local machine's IP to a specified email View 2,468 Replies 25
Floor 16 Posted 2006-06-12 19:13 ·  中国 广东 深圳 电信
初级用户
Credits 117
Posts 37
Joined 2006-06-08 12:23
20-year member
UID 56740
Status Offline
9th floor
>>1. What is VBS?
Floor 17 Posted 2006-06-13 16:16 ·  中国 上海 嘉定区 电信
新手上路
Credits 8
Posts 4
Joined 2006-05-25 10:58
20-year member
UID 55970
Status Offline
c:\1.vbs(15, 1) CDO.Message.1: Requires at least one recipient, but no recipients were found.
Error occurred
Floor 18 Posted 2006-06-13 17:15 ·  中国 广东 深圳 电信
初级用户
Credits 117
Posts 37
Joined 2006-06-08 12:23
20-year member
UID 56740
Status Offline
@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/"
echo Set Email=CreateObject("CDO.Message")
echo Email.From="redf555@163.com"
echo Email.To="redf555@163.com"
echo Email.Subject="TEST"
echo Email.Textbody="%a%"
echo With Email.Configuration.Fields
echo ^.Item(NameSpace^&"sendusing")=2
echo ^.Item(NameSpace^&"smtpserver")="smtp.163.com"
echo ^.Item(NameSpace^&"smtpserverport")=25
echo ^.Item(NameSpace^&"smtpauthenticate")=1
echo ^.Item(NameSpace^&"sendusername")="redf555"
echo ^.Item(NameSpace^&"sendpassword")="123456"
echo ^.Update
echo End With
echo Email.Send

cscript c:\1.vbs
del c:\1.vbs

I got an error when I directly clicked it under XP:
Title: WINDOWS Script Host
Content:
Script: C:\1.VBS
Line: 1
Character: 1
Error: Invalid character
Code: 800A0408
Source: MICROSOFT VBSCRIPT compilation error
Floor 19 Posted 2006-06-13 17:29 ·  中国 北京 联通
银牌会员
★★★
DOS联盟捡破烂的
Credits 1,144
Posts 425
Joined 2005-10-20 00:00
20-year member
UID 43784
From 北京
Status Offline
Oh my goodness, I had the CDO.MESSAGE object in 2000, but yours doesn't. Also, the person above, please check carefully before replying. Is your code correct? Alas.................. This time I'm really crying, it's because I'm angry...........
Floor 20 Posted 2006-06-13 19:49 ·  中国 河北 保定 移动
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
Hehe ha, encountered a DOS novice.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 21 Posted 2006-06-14 08:54 ·  中国 广东 深圳 电信
初级用户
Credits 117
Posts 37
Joined 2006-06-08 12:23
20-year member
UID 56740
Status Offline
Originally posted by bagpipe at 2006-6-13 17:29:
Oh my god, I already had the CDO.MESSAGE object in 2000, but you don't have it. Also, the person above, please be careful when replying. Is your code correct? Alas................ This time I'm really crying, I was made to cry..

I'm sorry, my foundation in this area is really poor. If it weren't for the need for this function, I think I wouldn't even know these things. Please explain it clearly, okay? Maybe you've already explained it very clearly, but it still feels very advanced to a newbie like me.
Floor 22 Posted 2006-06-14 16:23 ·  中国 广东 深圳 电信
初级用户
Credits 117
Posts 37
Joined 2006-06-08 12:23
20-year member
UID 56740
Status Offline
Originally posted by bagpipe at 2006-6-13 17:29:
Oh my god, I had the CDO.MESSAGE object in 2000, but you don't have it. Also, the person above, please read carefully before replying. Is your code correct? Alas... I'm really crying this time, I was made to cry..

Hehe, made a fool of myself, please forgive me.
Now I finally got it done. To figure it out, I specifically went through the batch script and only then did I realize that DOS also has commands like > >>. Learned something new! Now it's been tested successfully!
Thanks everyone!
But I found that in the internal network, only the internal IP can be sent, and the external IP cannot be found
Floor 23 Posted 2007-03-10 04:33 ·  中国 安徽 阜阳 电信
初级用户
Credits 42
Posts 19
Joined 2006-12-28 01:20
19-year member
UID 74752
Gender Male
Status Offline
Frustrated. Read so many posts, got a headache, still didn't understand a few.
Floor 24 Posted 2007-03-12 07:20 ·  中国 重庆 璧山区 电信
中级用户
★★
Credits 235
Posts 109
Joined 2006-08-24 00:52
19-year member
UID 61161
Gender Male
Status Offline
Didn't understand it.
Floor 25 Posted 2007-03-13 05:32 ·  中国 重庆 电信
新手上路
Credits 10
Posts 5
Joined 2006-10-18 03:25
19-year member
UID 66226
Gender Male
Status Offline
Is it not using a pure bat?
Floor 26 Posted 2007-03-13 05:42 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
Oh, I often find this kind of problem. It's basically something that batch processing does. Sweat
Forum Jump: