Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: suppressing password in telnet batch file  (Read 6314 times)

0 Members and 1 Guest are viewing this topic.

abc

  • Guest
suppressing password in telnet batch file
« on: June 28, 2006, 07:26:00 AM »
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 <hostname>
C:\WINNT\system32\cscript.exe  //nologo telnet.vbs
del telnet.vbs

Thanx

porfuse

  • Guest
Re: suppressing password in telnet batch file
« Reply #1 on: June 28, 2006, 07:45:36 AM »
cls ? right after the pass is displayed ? where is the pass displayed ? top, bottom...do some rearranging

abc

  • Guest
Re: suppressing password in telnet batch file
« Reply #2 on: June 28, 2006, 08:13:13 AM »
At the statement set /p password=Enter Password:

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: suppressing password in telnet batch file
« Reply #3 on: June 28, 2006, 09:44:35 AM »
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-)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein