i tested on w7 (hprem)
as limited user
the code failed (without error) to write to HKCR

running as limited user, run as administrator, the file association worked correctly and the command string was then processed correctly