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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
silent
Posts: 44
Joined: 28 Oct 2011 14:40

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

#1 Post by silent » 30 Dec 2011 12:54

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)

aGerman
Expert
Posts: 3887
Joined: 22 Jan 2010 18:01
Location: Germany

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

#2 Post by aGerman » 30 Dec 2011 13:25

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

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

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

#3 Post by orange_batch » 30 Dec 2011 17:38

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"

Post Reply