3

I have added the following command to the runonce registry to run a specific python script on start up with a long list of parameters as follows

HKLU..."fio-test"=C:\Python26\python.exe C:\Users\Administrator\Desktop\workspace\test_Windows_dc_policy_flush_on_restart\test_Windows_dc_policy_flush_on_restart.py -I /dev/fct4 -b E -v "C:\Users\Administrator\Desktop\workspace\test_Windows_dc_policy_flush_on_restart\test_actions.p"

However, the command will never run and the registry will not be removed for the script. IE. the runonce part of the windows boot manager will ignore the entry. I can find the entry and see it in the proper location and see other less complicated scripts run and be removed from the registry. My question is as follows.. What are the limitation of the run once that I am running into? am I running into a max command length issue? or, is it some type of unescaped character that causes the script to be ignored?

1
  • 7
    Figured it out. Windows has a 256 character limit on commands ran from the RunOnce registry in HKLU or HKLM. One more reason I try to avoid windows at all costs. Jun 20, 2012 at 22:13

1 Answer 1

0

The Task Scheduler is a more flexible and powerful of launching these types of tasks. You should be able to use it to get around the command length limitation.

1
  • True, but then you have to deal with removing the scheduled task from the scheduler when you are done with it, unless the task scheduler supports tasks that run only once; I am not that familiar with the tool. What I did was put my command into a self deleting batch file and run the batch file. Jun 21, 2012 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.