|i think you need to have the program run reg.exe via shell:|
shell ("reg import "+k+" startup"),0
i'm not familiar with where Xp puts its registry startup programs, but in winME its at the value assigned to "k" above.
the safest method would be to use regedit to add the logger program, then export the startup information, then use that as the import file on subsequent runs. Not sure why you would need to edit the registry each time however, but you must have reason for wanting to do that.