Name: vortech Date: August 10, 2006 at 16:56:17 Pacific Subject: Batch - Store a command 4 later use OS: Windows 2000 CPU/Ram: Athlon, 1 Gig Memory Model/Manufacturer: Home Built
Comment:
I'm executing windump.exe (a command line sniffer) via a batch file. How do I get the batch file to continue to the next line after launching the program?
I've done a start /min windump.exe, but this launches windump in another "dos window" which is sorta lame.
Also, is there anyway to store a command in a batch file that can be executed later in the batch file, regardless of what the batch files doing.
I'm thinking if I can't use Control C to kill windump (since it kills the batch file) can I store a command such as pskill.exe -k windump.exe which would terminate windump.exe by me pressing a certain key.
I don't think you'll be able to do this with a simple batch file. You need to use a more powerfull scripting language such as Perl, or Pyton, or any of the VB variants.
The best soulution would be if you can call a program that quits itself/just dumps data..
Another solution is to call windump with the "start" command in front and then have a taskkill on the next line. You would need a break timer tho, or it would kill windump at once. Or you can use pause, and press a key to kill windump.
You can use ping -n 5 localhost>nul for a aprox. 5sec break
And no, afaik you cant assign a key to a spesific comand in batch.