#! perl -w use strict; use Win32::OLE; my $wshShell = Win32::OLE->new('WScript.shell'); $wshShell->sendkeys("{NUMLOCK}"); __END__ perl -MWin32::OLE -e "Win32::OLE->new('WScript.shell')->sendkeys('{NUMLOCK}')"