Computing.Net > Forums > Programming > Batch - Store a command 4 later use

Batch - Store a command 4 later use

Reply to Message Icon

Original Message
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.

Thanks for any assistance.



Report Offensive Message For Removal

Response Number 1
Name: FishMonger
Date: August 10, 2006 at 19:07:12 Pacific
Subject: Batch - Store a command 4 later use
Reply: (edit)

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.


Report Offensive Follow Up For Removal

Response Number 2
Name: Shr0Om
Date: August 11, 2006 at 02:13:39 Pacific
Subject: Batch - Store a command 4 later use
Reply: (edit)

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.


Report Offensive Follow Up For Removal

Response Number 3
Name: vortech
Date: August 11, 2006 at 20:57:41 Pacific
Subject: Batch - Store a command 4 later use
Reply: (edit)

Thanks all for the info..

Shr0Om, I ended up going with your advice and just doing a start and then just assigning a key to kill the task. Not pretty but it works.

Thanks all!


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Batch - Store a command 4 later use

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software