fly Posted July 26, 2007 Posted July 26, 2007 So I'm running a vbscript file in BartPE (a limited 32-bit environment, for those that dont know) that requires a password. Obviously, vbscript doesn't allow for masking passwords, and the "normal" methods for trying don't work in BartPE. So my question is, is there a way to launch a AutoIt executable that will prompt for a password, then pass it back to the vbscript? Thanks for any help guys.
lordofthestrings Posted July 27, 2007 Posted July 27, 2007 (edited) figure out how to HTA for bartPE <html> <head> <title>Password Box Demo in HTA</title> <HTA:APPLICATION ID="oHTA" APPLICATIONNAME="Passwordbox" SCROLL="NO" SINGLEINSTANCE="NO" WINDOWSTATE="maximize" > </head> <script Language="VBScript"> Sub runscript() MsgBox "Your password :" & PasswordArea.Value, 0, "" End Sub </SCRIPT> <body> <input type="text" name="BasicTextBox" size="50" title="Username"><BR> <input type="password" name="PasswordArea" size="30" title="passwordbox"> <input id=runbutton class="button" type="button" value="Run Button" name="run_button" onclick="RunScript"> </body> </html> save this as run.hta and see if this helps.. (you need to add the MS HTA Package to your builder) have a nice day Edited July 27, 2007 by lordofthestrings
GEOSoft Posted July 27, 2007 Posted July 27, 2007 (edited) fly said: So I'm running a vbscript file in BartPE (a limited 32-bit environment, for those that dont know) that requires a password. Obviously, vbscript doesn't allow for masking passwords, and the "normal" methods for trying don't work in BartPE. So my question is, is there a way to launch a AutoIt executable that will prompt for a password, then pass it back to the vbscript? Thanks for any help guys.In AutoIt use an InputBox with the password flag $Pass = InputBox("My App", "Please enter your password","","*") Pass it to the clipboard ClipPut($Pass) Exit the script When you open the VB script, read the password from the clipboard. Have you looked at the possibility of just converting the vbs to AutoIt? That would make the whole process easier. Edit: $Pass = InputBox("My App", "Please enter your password","","*") If $Pass Then ClipPut($Pass) ShellExecute(<Path> & "\Bart.vbs") EndIf Exit Edited July 27, 2007 by GEOSoft George Reveal hidden contents Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
lordofthestrings Posted July 27, 2007 Posted July 27, 2007 you're right: AutoIt works just fine on BartPE.. so why not get the advantage of masking your code in one Executable..
fly Posted July 27, 2007 Author Posted July 27, 2007 The reason its not totally done in AutoIt is that I'd like to keep it as simple as possible so others in my group understand what is going on, without having to search for and/or understand AutoIt. However, I may be forced to do the whole thing in AutoIt, as I'm not sure I can grab clipboard contents via VBScript in Bart. Or I could go the HTA route, but damn do I hate (even limited) HTML coding. Thanks for your help, as usual guys. If anyone has any other suggestions, I'd love to hear em.
DaleHohm Posted July 27, 2007 Posted July 27, 2007 Another options is to run your VBScript inline with your AutoIt code. Search the forum for examples of the use of the "ScriptControl" COM object and you'll be surprised at the doors that might open for you. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble
PsaltyDS Posted July 27, 2007 Posted July 27, 2007 You have other good options now from the smart people. This is kind of a brute-force method from one of the dimmer lights. Compile the following in AutoIt as GetPass.exe: ; GetPass.au3 -- passes an input password out to the console ConsoleWrite(InputBox("Password", "Password: ", "", "*")) Run the following from a command prompt: for /f %P in ('GetPass.exe') do (echo %P) If you can do that from the CMD shell command line, you can do it from VB. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
fly Posted July 27, 2007 Author Posted July 27, 2007 You guys never cease to amaze me with new and different ways to skin a cat.
GEOSoft Posted July 27, 2007 Posted July 27, 2007 fly said: You guys never cease to amaze me with new and different ways to skin a cat.there hasn't been any truly "NEW" code written in a long time. It's all just different approaches to old code and different applications for that code. George Reveal hidden contents Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now