Cygwin breaks net use Z: /delete in scripts?

Corinna Vinschen
Fri Aug 11 08:55:07 GMT 2023

First of all, do not send unsolicited email to my private address.
Especially, please don't use my company email address.

Keep Cygwin stuff on the cygwin list.

On Aug 11 10:25, Martin Wege wrote:
> Hello,
> Cygwin somehow breaks unmounting of network shares, but ONLY if the
> net use /delete happens in a bash shell script.
> Example:
> Mount SMB network share on Z:
> Do not touch Z:!
> Then do a net use /delete in a bash script:
> net use Z: /delete
> Systemfehler 1794 aufgetreten.
> Der Redirector wird verwendet und kann nicht aus dem Speicher entfernt werden.
> If I execute the net use Z: /delete in an interactive bash shell it works.
> Can anyone explain this?

Something is wrong on your side, but no, I can't explain it.  It's
not related to Cygwin:

$ cat > <<EOF
net use Z: /delete
$ chmod +x
$ net use Z: \\\\server\\share
The command completed successfully.

B:[~]$ ./
Z: was deleted successfully.


More information about the Cygwin mailing list