Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8350695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:23:55+00:00 2026-06-09T08:23:55+00:00

I have a VBScript copied from the link http://www.robvanderwoude.com/vbstech_ui_password.php In the existing VBSscript I

  • 0

I have a VBScript copied from the link http://www.robvanderwoude.com/vbstech_ui_password.php

In the existing VBSscript I have added the code for the “Internet Explorer version” :

WS SCRIPT – named Password.vbs (see full script in the above link)

strPw = GetPassword( "Please, type your password:" ) 

Sub Submit_OnClick
Const ForWriting = 2
Dim filesys, filetxt, FormContent
Set FormContent = document.getElementById("strPw")
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile("c:\temp.txt", ForWriting, True)
filetxt.WriteLine(FormContent.value) 
filetxt.Close
End Sub   

BATCH SCRIPT

@echo off 

SET VALIDPASSWORD=1234

wscript Password.vbs

findstr %VALIDPASSWORD% c:\temp.txt
if ERRORLEVEL 1 (
     echo Incorrect password.
     goto :EOF
 ) else (
     echo Password correct. 
)

echo Batch continues from here
pause

:EOF
exit /b

The file temp.TXT should be sent to the c:\ with the information the user typed on the inputbox. The batch would read this input and compare to a set password and continue the coding…

How can I make this work?? the temp.TXT is not generated an so forth …

BATCH and VBS gurus out there, any help to SOLVE these problems is really welcomed !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:23:57+00:00Added an answer on June 9, 2026 at 8:23 am

    If C:\temp.txt isn’t being created, then the first problem is not with the batch file.

    The author of the article you linked to mentions that this code does not work on Win7. I don’t have a non-Win7 machine handy to test on, but I doubt that IE has permission to write to the root of your C: drive (his code does not do this). Another possibility is that Password.vbs is not in the same path where your batch file is. You would get an error message if that were the case, though.

    Since this will be run from a command line anyway, why not try modifying the much simpler WScript version that he posted? Assuming this is being run by a non-administrator, and depending on which OS this is running on, you will need to use a directory that the user has permission to write to (say, for example, %TEMP%\temp.txt).

    Having said that, there are a couple more problems you’ll run into. For one, your OpenTextFile call uses the ForAppending mode (that’s the ‘8’ in there). This means that your temp.txt file will hold all of the answers users have ever entered. This also means that when you do your findstr, if anyone has ever put in the proper password, the check will succeed. It would be better to use ForWriting so it is newly generated each time. See this MSDN article for more information.

    This method is not a secure way to handle passwords. For one thing, the user could just read the contents of the batch file where you’re storing the valid password, or even easier, they could just see what’s supposed to happen if they do get the password correct. But if you must do it this way, I would recommend changing your batch file to something like this:

    @echo off
    REM This file assumes that you switch to a wscript version 
    REM and use the recommendations I gave.
    
    SET VALIDPASSWORD=IAmTheRightPassword
    
    wscript Password.vbs
    findstr %VALIDPASSWORD% %TEMP%\temp.txt
    if ERRORLEVEL 1 (
        echo Incorrect password.
        goto :EOF
    ) else (
        echo Password correct.
    )
    REM Here's where you put whatever you were going to do if 
    REM the password was correctly entered.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a VBScript COM Component where I'm using Msxml2.FreeThreadedDOMDocument.4.0 however is there /
I have some vbscript code I use to set paths to virtual directories when
In VBScript I have code: someLongValue = CLng(DateSerial(2011, 11, 1)) and in that case
I have written a VBScript to extract data from Active Directory into a record
I have a VBScript code snippet which converts my xls and xlsx files into
I have a VBScript that does a number of tasks, including moving files from
Context: Windows7, VBScript, ADODB and ADOX. I have written some VBScript code which creates
I have a VBScript app calling COM-registered C# objects. I am able to pass
I have the following VBScript code: Dim returnVal returnVal = You did not pass
I have VBScript code which launches QuickTest Professional, executes a series of QTP tests,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.