Derived from Microsoft Knowledge Base Articles Q179987 and Q177674
SYMPTOMS
Executing at least two SendKeys statements in a row results in turning off the NumLock key. This problem may also affect the CapsLock and ScrollLock keys.
CAUSE
This problem deals with a nesting of capturing the keyboard state. The first SendKeys statement takes a snapshot of the keyboard state and turns off all toggles. The second SendKeys statement executes before the first one played out all keys and restored the keyboard state. So, the keyboard state is recorded again by the second SendKeys, this time with all toggles still off. Eventually, the keyboard state is restored to the later state (toggles off).
RESOLUTION
To work around this problem, do one of the following: