Duanra Posted March 5, 2008 Share Posted March 5, 2008 Hi all In an AutoIT script, I have to execute a VB script (with the RunWait command : RunWait("C:\WINDOWS\system32\wscript.exe " & $ScriptName,$PathToScriptFolder,@SW_HIDE) ). This VB script has to connect to a database using a password. But I don't want this password to be wrote in the VB script (because he can be visible by anyone editing the VB script). I would rather like to write it in the AutoIT script and then to send it to the VB script in a confidential way. Do you have a solution (or a begining of solution!) for me ? Thanks ! Link to comment Share on other sites More sharing options...
Bert Posted March 5, 2008 Share Posted March 5, 2008 In your VB script, you have a place to type in a password I assume? If so, then just do a controlsend to it. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
MHz Posted March 5, 2008 Share Posted March 5, 2008 But I don't want this password to be wrote in the VB script (because he can be visible by anyone editing the VB script).FYI, There is a VBS encoder from MS that can encode the script into something that others cannot read. Pass arguments to the VBS file and then process the arguments within the VBS file Au3 snip of code $switches = '"My password here"' RunWait('"C:\WINDOWS\system32\wscript.exe" "' & $ScriptName & '" ' & $switches, $PathToScriptFolder, @SW_HIDE) VBS snip of code Set oArgs = WScript.Arguments If oArgs.Count() > 0 Then Password = Args.item(0) End If Link to comment Share on other sites More sharing options...
Duanra Posted March 5, 2008 Author Share Posted March 5, 2008 FYI, There is a VBS encoder from MS that can encode the script into something that others cannot read. Pass arguments to the VBS file and then process the arguments within the VBS file Au3 snip of code $switches = '"My password here"' RunWait('"C:\WINDOWS\system32\wscript.exe" "' & $ScriptName & '" ' & $switches, $PathToScriptFolder, @SW_HIDE) VBS snip of code Set oArgs = WScript.Arguments If oArgs.Count() > 0 Then Password = Args.item(0) End If Great ! Thank ya very much MHz ! This solves my problem. See you ps : I just bring a little correction to your VB snip of code : Set oArgs = WScript.Arguments If oArgs.Count() > 0 Then Password = oArgs.item(0) 'Here : oArgs instead of Args End If Link to comment Share on other sites More sharing options...
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