• Some amendments/corrections to my previous post:
  • Had specified the wrong variable in this example:

    //var %ticks = $ticks + 100 | while ($ticks < %ticks) ! | ...
  • The % $+ comspec% /c part and > nul parts aren't needed and it's slightly better to use 127.0.0.0 instead of local host therefore the new version:

    Code:
    alias pause {
      if ($1 !isnum 1-) return
      var %wsh = wsh $+ $ticks
      .comopen %wsh wscript.shell
      .comclose %wsh $com(%wsh,run,1,bstr*,pathping.exe -n -w 1 -q 1 -h 1 -n -p $iif($1 &gt; 40,$calc($1 - 40),$1) 127.0.0.0,uint,0,bool,true)
    }
  • The /pause snippet doesn't work on Windows 98/ME, nothing I can do, it needs pathping.exe which was only included from Windows 2000 on.
  • I might as well post the version that used ping.exe but only supports seconds, since that does work on 98:

    Code:
    alias pause2 {
      if ($1 !isnum 1-) return
      var %wsh = wsh $+ $ticks
      .comopen %wsh wscript.shell
      .comclose %wsh $com(%wsh,run,1,bstr*,ping.exe -n $int($calc($1 + 1)) 127.0.0.1,uint,0,bool,true)
    }


    Thanks to Online for some feedback.