Batch file 使用“网络用户”批处理文件;“未找到用户名”;批处理不挂起提示
我的批处理脚本执行以下操作:Batch file 使用“网络用户”批处理文件;“未找到用户名”;批处理不挂起提示,batch-file,cmd,dns,errorlevel,Batch File,Cmd,Dns,Errorlevel,我的批处理脚本执行以下操作: 用户输入用户名并添加到变量中 询问密码(对用户隐藏输入)并添加到变量的技巧 使用“net user”命令检查域组的用户名和密码身份验证 如果在集合组中找到用户,则继续映射驱动器 如果用户不是组的一部分,请在开始时重新启动 当找到用户名时,此脚本工作。 当在组中找到用户名时,此脚本起作用 问题是如果找不到用户名。 当找不到用户时,它会报告“通过键入NET HELPMSG 2221可以获得更多帮助” 它只是坐在那里,不会继续提示或做任何事情。 我重复了errorleve
@echo off
:Question
Echo.
Echo.
SET /P HelperName=Enter Witness' Name:
Echo.
If %HelperName% EQU %Username% GOTO SameUserName
cls
echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>%temp%\ftp.com
set /p password=What is your password? <nul
for /f "tokens=*" %%i in ('%temp%\ftp.com') do set "password=%%i"
del %temp%\ftp.com
cls
set i=0
set group=WGD
set user=%HelperName%
echo Checking if %user% is member of %group%...
for /f %%f in ('"net user %user% /domain | findstr /i %group%"') do set /a i=%i%+1
if %i% gtr 0 (goto :member)
:nomember
echo %user% is not member of %group% Please Try Again
goto :question
:member
net use L: \\10.10.10.10\foldernamehere\TEMP /user:wgd\%helpername% %password%
if [%errorlevel%]==[0] goto deletedrive
goto error
:deletedrive
net use /delete L:
goto start
@echo关闭
:问题
回声。
回声。
SET/P HelperName=输入证人姓名:
回声。
如果%HelperName%EQU%Username%GOTO SameUserName
cls
echo hP1X500P[PZBBBfh#b#fXf-V@`$fPf]f3/f1/5++u5>%temp%\ftp.com
set/p password=您的密码是什么 嗯,我似乎没有等足够长的时间来完成留言。它会挂起一点,然后继续执行脚本。然而,等待帮助消息清除的时间有点长,如果您知道如何更快地清除,请让我知道