in reply to Perl controling Windows

Maybe look at Win32::FetchCommand. Also inspect some suggestions here. Microsoft have some sample Perl scripts on their website here. Also search Microsoft's site for 'Perl' and you will find more.