You could try SENDKEYS but I'm sure that would meet with mixed results.

There is also a program called AUTOIT that might be able to help assist in pressing the right keys for you in an automated script. Search Google for it.