Not to clear which command isn't running, but I will try to answer the both I see. what is happening is it runs 1, then 10, then 11, then 2, .... You could add a 0 in front of the single digits, or you could make you taskkill command a lil smaller. taskkill /f /im cfgwiz.exe /im ccApp.exe /im ...... If the runonceex.cmd is not adding any registry entries, then post the rest of the file. What you have posted looks fine, but if you put quotes in the key value, then I can see why this would cause a problem, ie set key="HKLM\......"