Sunday, July 21, 2013

Enter username , password in form using batch file / Hide password batch file

Use below code and write into the file, which is ended up with *.bat. Save the file double click on file. After which a form will popup in which you can enter username and password and password is not visible.

@echo off

echo Please enter your user name and password in the entry box...
If not exist %0 goto ERROR
type %0 | find "    " | find /v "Not Me!" > %TEMP%\UserIn.hta
start /w %TEMP%\UserIn.hta

call %TEMP%\UserIn.bat
echo Your user name is %USERNAME%
echo Your password is %PASSWORD%
:: Clean up
del %TEMP%\UserIn.hta
del %TEMP%\UserIn.bat
goto DONE

echo %0 is not the full path and file name
echo for the batch file. You MUST call this
echo batch file with a full path and file name.
goto DONE

:: All HTA code MUST be indented four or more spaces.
    <title>Password Entry</title>
    <script language="vbscript">
        window.resizeTo 250,200
        Sub SaveBatch()
            Set fs = CreateObject("Scripting.FileSystemObject")
            strFile = fs.GetAbsolutePathName(fs.BuildPath(fs.GetSpecialFolder(2), "UserIn.bat"))
            Set ts = fs.OpenTextFile(strFile, 2, True)
            ts.WriteLine "SET USERNAME=" & document.Forms(0).elements("username").value
            ts.WriteLine "SET PASSWORD=" & document.Forms(0).elements("password").value
        End Sub
        User Name:
        <br><input type=text name=username tabindex=1>
        <br><input type=password name=password>
        <br><input type=button language="vbscript" value="OK"
        onclick="SaveBatch : Window.Close">
    <script language=vbscript>


below screen is of popup window

Wednesday, July 3, 2013

Hide password string in batch

Hide input string batch code
Mask password

here is the code::

@echo off
echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>
for /f "tokens=*" %%i in ('') do set "password=%%i"
echo The Password is:"%password%"
web stats