Board logo

标题: [网络连接] 批处理如何自动ping局域网内ip,通则映射该共享文件夹 [打印本页]

作者: 天舞·紫嫣    时间: 2020-9-13 17:51     标题: 批处理如何自动ping局域网内ip,通则映射该共享文件夹

如果能连接这个共享ip,则运行下面这个映射,如果连不通就给个不通的提示

还有能不能判定是否有开机密码?如果没有开机密码就设定开机密码后再运行映射
  1. if not exist h: net use h: \\10.143.227.1\文件夹1 /user:账号 "1234"  /persistent:yes
  2. if not exist y: net use y: \\10.143.227.1\文件夹2 /user:账号 "1234"  /persistent:yes
  3. if not exist z: net use z: \\10.143.227.1\文件夹3 /user:账号 "1234"  /persistent:yes
复制代码
大佬求助!!
作者: Batcher    时间: 2020-9-13 22:20

回复 1# 天舞·紫嫣


参考 ping + if 的用法:
http://bbs.bathome.net/thread-20578-1-1.html
http://bbs.bathome.net/thread-25586-1-1.html




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2