Microsoft KB Archive/156458

{|
 * width="100%"|

Net.exe Can Use Hidden Switches /Y /N for Unconditional Yes/No

 * }

Q156458

-

The information in this article applies to:


 * Microsoft Windows NT Advanced Server, version 3.1
 * Microsoft Windows NT Workstation versions 3.1, 3.5, 3.51, 4.0
 * Microsoft Windows NT Server versions 3.1, 3.5, 3.51, 4.0

-

SUMMARY
When you use Net.exe commands in a batch file, you can use the Y or N switch to unconditionally answer Yes or No to questions returned by the Net command.

MORE INFORMATION
Normally, you could pass a "Y" using Standard-in through redirection as in the following example:

  delshare.bat file contents: NET SHARE TOOLS /D <y.txt

Y.txt file contents: Y(cr) carriage return

But the following error occurs using this method when the Delshare.bat file is run and fails the operation.

NET SHARE TOOLS /D   Delshare.bat new contents: NET SHARE TOOLS /D /Y

After running this batch file, you will receive the following message:

  NET SHARE TOOLS /D /y Users have open files on TOOLS. Continuing the operation will force the files closed.

TOOLS was deleted successfully. Additional query words: std-in prodnt

Keywords : kbusage

Issue type :

Technology : kbWinNTsearch kbWinNTWsearch kbWinNTW400 kbWinNTW400search kbWinNT351xsearch kbWinNT350xsearch kbWinNT400xsearch kbWinNTW350 kbWinNTW350xsearch kbWinNTW351xsearch kbWinNTW351 kbWinNTW310 kbWinNTSsearch kbWinNTS400xsearch kbWinNTS400 kbWinNTS351 kbWinNTS350 kbWinNTS310 kbWinNTAdvSerSearch kbWinNTAdvServ310 kbWinNTS351xsearch kbWinNTS350xsearch kbWinNTS310xsearch kbWinNT310xSearch kbWinNTW310Search