自機のIPアドレスをクリップボードに入れる

ipconfigコマンドを実行し、ieを用いてクリップボードに入れる。

cmd =WScript.CreateObject("WScript.Shell");
exe=cmd.Exec("ipconfig.exe");
s=exe.StdOut.ReadAll();
ip=/\d+\.\d+\.\d+\.\d+/.exec(s)[0];
ie=WScript.CreateObject('InternetExplorer.Application');
ie.navigate('about:blank');
ie.Document.parentWindow.clipboardData.setData('text',ip);
ie.Quit();

忘れないように書いておこう。途中結果を出力したいときにはWScript.echo(s);