Page 1 of 1

batch launcher for an .exe and it will write ip there

Posted: 30 Dec 2011 12:54
by silent
Hi,i have some rcon hack for samp 0.3 made in c# but its so heavy that it crashes my internet if i run it for long time.I wanted to make a launcher so i will be able to play on server when it will run.I wanted to make it write ip 94.103.150.147 in the .exe program but i dont know how :(
Thats code i made

Code: Select all

@echo off
title Launcher
:START1
echo launching
(OUT OF CODE:heres time for meto launch game)
(IN CODE NOW)
ping localhost -n 8>nul
start rconcracker.exe
(HERE i want to type the ip but i dont know how to write it)
ping localhost -n 18>nul
taskkill rconcracker.exe
exit


Is there a way to write the ip ? (i cant edit the exe file)

Re: batch launcher for an .exe and it will write ip there

Posted: 30 Dec 2011 13:25
by aGerman
No, there is no way using batch. Try another scripting language (e.g. VBScript and the SendKeys method of a WScript.Shell object).

Regards
aGerman

Re: batch launcher for an .exe and it will write ip there

Posted: 30 Dec 2011 17:38
by orange_batch
viewtopic.php?f=3&t=2677&p=12235#p12235

...where "%{F3}" contains whatever key presses/special keys you want to enter. So "94.103.150.147" would suffice.

You may need to focus your application window first. So all together...:

Code: Select all

set a=wscript.createobject("wscript.shell")
if wscript.arguments.count=1 then a.appactivate wscript.arguments(0)
a.sendkeys "94.103.150.147"

Code: Select all

cscript presskey.vbs //nologo "Window Title of Application"