【发布时间】:2010-02-10 16:45:42
【问题描述】:
我需要在 cygwin 上自动执行“net use”命令。
命令是'net use /user:"name" \somewhere'。并且 'Enter the password for 'name' to connect to 'prosseek':' 应输入密码。
它适用于命令行输入,以及在批处理文件中运行时。 当我按如下方式制作期望脚本时它不起作用。
spawn net use /user:"name" \\prosseek\somewhere 期望“输入'name'的密码以连接到'prosseek':” 发送“密码\n” 相互影响我收到如下错误消息。
spawn net use /user:"name" \prosseek\somewhere 发生系统错误 67。找不到网络名称。
发送:无效的生成 id (4) 在执行时 "发送"密码\n"" (文件“conpros”第 9 行)
- 问:可能出了什么问题?
- 问:诸如“net use”之类的 MS 命令能否与 cygwin/expect 一起使用?
【问题讨论】:
标签: networking cygwin expect mount smb