I need to automate the net use command on cygwin.
The command is net use /user:"name" somewhere . And Enter the password for name to connect to prosseek : is expected to enter the password.
It works well with command line input, and when run inside batch file. It doesn t work when I make a expect script as follows.
spawn net use /user:"name" \prosseeksomewhere expect "Enter the password for name to connect to prosseek :" send "password " interact
I get error message as follows.
spawn net use /user:"name" prosseeksomewhere System error 67 has occurred.The network name cannot be found.
send: invalid spawn id (4) while executing "send "password "" (file "conpros" line 9)
- Q : What might be wrong?
- Q : Can some MS command something like net use be working with cygwin/expect?