If you want to run a program when you log-in to Windows, you do not have to write a program to do that ... let alone a Perl program. Study your business requirement and consider all of the possible alternatives for solving that problem ... no doubt, it is an extremely common one that has been solved before. Never do anything that has already been done.
I have searched for it in google to find one for to use. But, I did not find any thing.
Any ways, my requirment is that,
1. start mstsc.exe with the perl script
2.it should ask for servername
3.Enter the username and passowrd.