Dear Asif,
there is a nice and free program for windows automation called AutoIt,
which you could use in combination with Ruby:
_http://www.autoitscript.com/autoit3/_
(AutoIt Scripting Language - AutoIt)
and which might help you solve your problem.
Best regards,
Axel