Windows net在批处理文件中的使用-是提示

Windows net在批处理文件中的使用-是提示,windows,batch-file,windows-server-2008-r2,Windows,Batch File,Windows Server 2008 R2,我正在尝试编写net use命令的脚本: net user UserName ReallyLongPasswordHere /add 当我执行此操作时,会得到一个提示: The password entered is longer than 14 characters. Computers with Windows prior to Windows 2000 will not be able to use this account. Do you want to continue this

我正在尝试编写net use命令的脚本:

net user UserName ReallyLongPasswordHere /add
当我执行此操作时,会得到一个提示:

The password entered is longer than 14 characters.  Computers
with Windows prior to Windows 2000 will not be able to use
this account. Do you want to continue this operation? (Y/N) [Y]:
我怎么能做到这一点?我试过:

echo y| net user UserName ReallyLongPasswordHere /add
但这不起作用,它说“没有提供有效的回应”。Windows Server 2008R2就是运行此操作的地方


谢谢

您可以添加
/Y
/YES
来回答此提示

示例:

net user MyUser MyPasswordIsReallyLong /ADD /Y

(这是一项未记录的功能。)

我没有Windows Server,但请尝试
echonet use…
也许?看看哪里欢迎并回答这些问题。我知道这个答案很旧,但/Y在Windows Server 2016中不起作用