try this:

import std.process, std.stdio;
import core.thread;
import std.random;

void main(string[] args)
{
string on = "netsh interface set interface \"Connexion au réseau local\" Enable"; string off = "netsh interface set interface \"Connexion au réseau local\" Disable";

    while(true)
    {
        executeShell(on);
        const t=uniform(2000, 5000);
        writeln("timeout: ",t);
        readln();
        Thread.sleep(dur!("msecs")(t));
        executeShell(off);
        Thread.sleep(dur!("msecs")(2000));
    }
}

Reply via email to