1.

Solve : suppressing password in telnet batch file?

Answer»

Hi
I wrote the following telnet batch file, it is WORKING fine BUT it is DISPLAYING the password on the screen. How to suppress it.

@echo off
echo set sh=WScript.CreateObject("WScript.Shell")>telnet.vbs
echo WScript.Sleep 500>>telnet.vbs
set /p userid=Enter User Id:
set /p password=Enter PassWord:
echo sh.SendKeys "%userid%">>telnet.vbs 'USERID
echo WScript.Sleep 500>>telnet.vbs
echo sh.SendKeys "~">>telnet.vbs
echo WScript.Sleep 500>>telnet.vbs
echo sh.SendKeys "%password%">>telnet.vbs ' PASSWD
echo sh.SendKeys "~">>telnet.vbs
echo WScript.Sleep 500>>telnet.vbs
start /realtime telnet.exe
C:\WINNT\system32\cscript.exe //nologo telnet.vbs
del telnet.vbs

Thanxcls ? right after the pass is displayed ? where is the pass displayed ? top, bottom...do some rearrangingAt the statement set /p password=Enter Password:I'm not aware of any batch method to suppress a password. But since you're using VBScript anyway, this MAY work:

Code: [Select]Set objPassword = CreateObject("ScriptPW.Password")
WScript.StdOut.Write "Please enter your password:"

strPassword = objPassword.GetPassword()
Wscript.Echo
Wscript.Echo "Your password is: " & strPassword


Not all WINDOWS versions ship with a ScriptPW.Password object. If not, there is a way to do this with IE. Let US know. 8-)



Discussion

No Comment Found