Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 606527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:15:50+00:00 2026-05-13T17:15:50+00:00

I need to automate the ‘net use’ command on cygwin. The command is ‘net

  • 0

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” \\prosseek\somewhere
expect “Enter the password for ‘name’ to connect to ‘prosseek’:”
send “password\n”
interact

I get error message as follows.


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)

  • Q : What might be wrong?
  • Q : Can some MS command something like ‘net use’ be working with cygwin/expect?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:15:50+00:00Added an answer on May 13, 2026 at 5:15 pm

    You probably can’t use Cygwin’s expect with non-cygwin programs; Cygwin emulates posix ptys, while the Windows programs use Windows’ own terminal handling code, which knows nothing about the pipelines that expect is trying to read from and write to.

    You’ve also failed to escape your backslashes in expect; notice that the error message gives a different string from the one you passed in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to automate an command line application. It asks the user to enter
I need to automate the following command cmd=yes | vgremove <vgname> whenever I code
I need to automate a screenshot task, so I thought why not use automator?
I need to automate some tasks in Adobe InDesign CS3 from a .NET 4.0
I need to automate a process that involves getting data from a series of
I need to automate an IM client to update a status every few hours,
I need to automate navigation around a JavaScript powered website in Python so I
I need to automate a process whereby attachments are automatically downloaded from messages in
I need to automate my app by passing a series of parameters to it
Renting houses can be nasty so I need to automate it. Please, have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.