Hey, I am pretty new to c programming & I want to do a few things but I am not sure on how to.

Well here are my questions,
1. I can execute commands like dir in dos by using the system(""); function, but how would I create one to do the command dir *.txt? I already tried system("dir *.txt"); to no avail.

2. How would I go about editing the registery? Example: The user can select to either have my program started on the startup or not to, So it just needs to have an entry to the registery.

Thanks a lot,
~Jonathan