[Help] Run commands on command prompt [Solved]

Posts 114 of 14 · Page 1 of 1
[Help] Run commands on command prompt [Solved]
ok so im back again lost again. ok in the past to test the server we have been using a bat file to start the game heres the code
Code:
@start bin32\aion.bin -ip: -port:2106 -cc:1 -noauthgg -noweb -lang:enu
ok so what it does is starts aion and tells it what ip and port to connect to what country code(cc), that there is no game guard auth needed and no web, and that the lang is English.

ok all that isnt needed all i need is the ip and port and convert that all the VB

i tried
Code:
 Process.Start("cmd.exe")
        SendKeys.Send("@start bin32\aion.bin -ip:IP Here -port:2106 -cc:1 -noauthgg -noweb -lang:enu {Enter} exit {Enter}")
which worked......the first time after that it kept opening 10+ command prompts then tossed errors because it typed 1 part of that line in each box
is there any way to limit the amount it can open or a different way to go at this
i really dont care if there is a cmd that opens and closes thats not a big deal if i cant get it meshed with this it will run off that bat anyhow.
Shell("@start bin32\aion.bin -ip: -port:2106 -cc:1 -noauthgg -noweb -lang:enu")
Quote Originally Posted by Blubb1337 View Post
Shell("@start bin32\aion.bin -ip: -port:2106 -cc:1 -noauthgg -noweb -lang:enu")
ok this is what i was trying before but i keep getting a file not found error after i build it and place the exe in the folder
folder structure
NCSoft>Aion(where launch goes)>bin32(where aion.bin is located)
Code:
        Process.Start("cmd.exe")
        SendKeys.Send("@start bin32\aion.bin -ip:IP Here -port:2106 -cc:1 -noauthgg -noweb -lang:enu {Enter} exit {Enter}")
        While True
            Dim p As Process() = Process.GetProcessesByName("cmd.exe")
            If p.Length > 1 Then
                Do Until p.Length = 1
                    p(0).Kill()
                Loop
            End If
        End While
Give it a try, for me it works.....

Edit:
Or do what Blubb said
Why would you do such complicated crap o_o?
lol That is the most basic thing for me xD (And Im noob XD)

You can do that:
Code:
Shell("YOURCODE", vbhide) ' vbHide is to the cmd doesnt show..




Code:
Dim psi as new ProcessStartInfo()
psi.FileName = "cmd.exe"
psi.Arguments = "@start bin32\aion.bin -ip: -port:2106 -cc:1 -noauthgg -noweb -lang:enu"
Process.Start(psi)
Try my source

On Error Goto Err
Process.Start("cmd.exe")
SendKeys.Send("@start bin32\aion.bin -ip:IP Here -port:2106 -cc:1 -noauthgg -noweb -lang:enu {Enter} exit {Enter}")
Err:
msgbox("Error Occured on Attempt!", vbCritical+vbOkOnly, "Error")

i mean, atleast mine gives a error.
Try it w/o the @start.
ok so i guess its not smart to try and code on a huge lack of sleep ty so much i never thought to remove the @start it works perfect now i can finally finish the rest of this and we can release our game server ty again and ty to all that posted
Shell by default start's at the program's directory. (eg: C:\Users\Blah\Documents\Visual Studio 2010\Projects\SomeThing\Debug). You have to include the whole path otherwise it will go looking in the same fodler as your program.

Quote Originally Posted by master131 View Post
Shell by default start's at the program's directory. (eg: C:\Users\Blah\Documents\Visual Studio 2010\Projects\SomeThing\Debug). You have to include the whole path otherwise it will go looking in the same fodler as your program.

right and the way its set up to run is you put it in the aion folder then it looks for bin32/aion.bin
again folder structure of aion
NCSoft/Aion(launcher goes here)/bin32/aion.bin<---- starting file
the code worked perfect ty again blubb
Well, it is solved now anyways.
What don't you people get about not posting in solved threads?
Posts 114 of 14 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?