You are here

.bat file help

4 posts / 0 new
Last post
Kevster
Offline
Last seen: 14 years 9 months ago
Joined: 2009-03-21 22:08
.bat file help

I need guidlines to writing a .bat file, I am searching for a command that types a certain string for example like:
"type: lala" if you had a word processor it would type "lala"
I don't know a function that would find a window name thats running, if you had calculator running it would search it and see if it's running. And if it came back negative (0) or "no calculator found" it would send a message "Please Open Calculator". Here's how far I got Blum

@ECHO OFF
ECHO LOL
ECHO LOL
ECHO LOL
ECHO.

digitxp
digitxp's picture
Offline
Last seen: 13 years 1 month ago
Joined: 2007-11-03 18:33
AutoHotKey

The majority of folks here use AutoHotKey. It's a lot prettier (as in it can draw GUIs, modify running windows, and other really cool stuff).
In AutoHotKey your described script (the one about the calculator) would be written as so:

#notrayicon
#singleinstance, force

inputbox, lookforwindow, Input Window Name, Type the name of the window to look for here,,150,0,0
ifwinnotexist, %lookforwindow% 
{
msgbox, Cannot find window %lookforwindow%.
exitapp
}

Good luck!

Insert original signature here with Greasemonkey Script.

Kevster
Offline
Last seen: 14 years 9 months ago
Joined: 2009-03-21 22:08
Other Features?

So can AHK type strings for me? And FindWindow for my purpose needs to verify a preset window within the code (example claculator is already in the script).
Sorry for being all picky but I need that script to only execute the commands if window is found. If window is not found "Calculator is not found, Please Open it" or something like that. Calculator is just an example in all this.

I was originally trying to write this in C++ but couldn't figure how to make it look "console like".

digitxp
digitxp's picture
Offline
Last seen: 13 years 1 month ago
Joined: 2007-11-03 18:33
Simple

You might also want to check out their Quick Stat Tut so you get a good idea of how it works.
If you already know what the title is, you can replace %lookforwindow% with Calculator (The % signs are the variable markers for AHK) and get rid of the inputbox.
And AHK can also send keystrokes with the Send command.

Insert original signature here with Greasemonkey Script.

Log in or register to post comments