Michael10 Posted September 21, 2013 Share Posted September 21, 2013 Hello, Im trying to make a simple script which logs me into steam. The idea is that i run the file with 2 arguments. (User/password). But im not able to accomplish the task. Could someone pls point me in the right direction ? This is the code : Run ("C:Program FilesSteamsteam.exe -login USER PASSWORD") If i replace user/password with the actual info, it works. But i need to send the informations as arguments, since i have several accounts. like this : steamlauncher.exe test 1234 Thanks in advance Michael Link to comment Share on other sites More sharing options...
Malkey Posted September 21, 2013 Share Posted September 21, 2013 This method might work for you. Local $aUser_Password[2] = ["test 1234", "test2 password2"] ; Put the list of User names and passwords into an array. For $i = 0 To UBound($aUser_Password) - 1 Run ("C:\Program Files\Steam\steam.exe -login " & $aUser_Password[$i]) ; Or Run("steamlauncher.exe " & $aUser_Password[$i]) Next Link to comment Share on other sites More sharing options...
Michael10 Posted September 21, 2013 Author Share Posted September 21, 2013 This method might work for you. Local $aUser_Password[2] = ["test 1234", "test2 password2"] ; Put the list of User names and passwords into an array. For $i = 0 To UBound($aUser_Password) - 1 Run ("C:\Program Files\Steam\steam.exe -login " & $aUser_Password[$i]) ; Or Run("steamlauncher.exe " & $aUser_Password[$i]) Next Thanks for your reply malkey. But this isnt quite what im looking for. With your example, all users/passwords are store into the script.I want to be able to provide that with paramaters. I have been looking at this: Run ("C:Program FilesSteamsteam.exe -login") & $CmdLine[1] $CmdLine[2] But sometimes i get syntax errors sometimes expression errors. Link to comment Share on other sites More sharing options...
michaelslamet Posted September 22, 2013 Share Posted September 22, 2013 Hi Michael, Something like this should work: Run ("C:\Program Files\Steam\steam.exe -login " & $CmdLine[1] & " " & $CmdLine[2]) Before that you might want a error checking like this: If $CmdLine[0] <= 0 ; if there is no parameter given ; display help or exit EndIf Link to comment Share on other sites More sharing options...
Michael10 Posted September 22, 2013 Author Share Posted September 22, 2013 (edited) Hey Michael, Its working perfectly, thanks mate One last question though. How can i add another parameter to the Run line ? Like this : Run ("C:Program FilesSteamsteam.exe -login " & $CmdLine[1] & " " & $CmdLine[2] steam//validate/227100) This is how it looks and works in cmd window : C:Program FilesSteamsteam.exe -login user password steam//validate/227100 Regards Michael Edited September 22, 2013 by Michael10 Link to comment Share on other sites More sharing options...
michaelslamet Posted September 22, 2013 Share Posted September 22, 2013 Glad to help This is what you want: Run ("C:\Program Files\Steam\steam.exe -login " & $CmdLine[1] & " " & $CmdLine[2] & " steam//validate/227100") Link to comment Share on other sites More sharing options...
michaelslamet Posted September 22, 2013 Share Posted September 22, 2013 So use & to combine a string, begin and end it with " or ' If it is a variable, do not use " or ' Link to comment Share on other sites More sharing options...
Michael10 Posted September 22, 2013 Author Share Posted September 22, 2013 You Sir..saved my day. Thanks alot!! 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