中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-12 01:42
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [求助]难题,再更新,还继续求助中:如何替换~|为☆ 查看 2,461 回复 15
16 发表于 2010-07-24 23:07 ·  中国 福建 厦门 电信
新手上路
积分 18
发帖 18
注册 2008-12-18 21:51
17年会员
UID 134292
性别 男
状态 离线
用VBS就能又快又好,只是不知道批处理可否。

附上VBS源码:


content1="~|"
content2="☆"
name1="1.txt"
name2="2.txt"

set fso=createobject("scripting.filesystemobject")

set file=fso.opentextfile(name1,1)
if file.AtEndOfStream<>true then
content=file.readall
file.close
content=replace(content,content1,content2)
set file=fso.opentextfile(name2,2)
file.write content
file.close
else
file.close
end if
论坛跳转: