ファイルにWinny接続ログを取ることを考えた。
2つのC言語ソースファイルをコンパイルして、startMain.exeを実行。

/* ファイル名:startMain.c */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>

void main(void)
{
time_t timer;
time_t nowTime;

time(&timer);
while(!kbhit()) { /* 何かキーを押したら終了 */
time(&nowTime);
if ((nowTime - timer) > 3L) { /* 3秒ごとにnetstat */
system("netstat -nb | output");
timer = nowTime;
}
}
}