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?

Joey
  • 344,408
  • 85
  • 689
  • 683
Rusty Weber
  • 1,541
  • 1
  • 19
  • 32
  • 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. – Rusty Weber Jun 20 '12 at 22:13

1 Answers1

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.

Adrian McCarthy
  • 45,555
  • 16
  • 123
  • 175
  • 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. – Rusty Weber Jun 21 '12 at 18:03