Jump to content

How to parse arguments to Run command


Michael10
 Share

Recommended Posts

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

 

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

Hey Michael,

Its working perfectly, thanks mate :thumbsup:

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 by Michael10
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...