我需要在cygwin上自動執行'net use'命令。cygwin的期望不適用於淨使用?
該命令是'net use/user:'name「\ somewhere'。並且'輸入'name'的密碼連接'prosseek':'預計輸入密碼。
它在命令行輸入和批處理文件中運行時效果很好。 當我按如下方式製作預期腳本時,它不起作用。
spawn net use /user:"name" \\prosseek\somewhere expect "Enter the password for 'name' to connect to 'prosseek':" send "password\n" interact
我遇到錯誤信息如下。
spawn net use /user:"name" \prosseek\somewhere System error 67 has occurred.The network name cannot be found.
send: invalid spawn id (4) while executing "send "password\n"" (file "conpros" line 9)
- 問:什麼可能是錯的?
- 問:一些MS命令可以使用cygwin/expect嗎?