2

I'm making a Cloud Drive program for my university (like dropbox for example, but much simpler), which let users automatically upload files on a server and share them with other users

I wanted to make an option, so that if someone boots the machine, the process will start automatically What I think I have to do is to add an entry in the register at the key: HKEY_LOCAL_MACHINE/sofware/Windows/CurrentVersion/Run and I wrote these lines of code:

system("REG ADD HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Run /v uCloud.exe /t REG_SZ /d \"C:\\Desktop\\uCloud\\uCloud.exe\" /f");

I also tried with the functions: RegOpenKeyEx and RegSetValueEx

the problem is that in both the cases I need administrator rights

If I edit the HKEY_CURRENT_USER the program automatically starts on boot, but it doesn't work at all (I mean I see the process, but it does nothing. I have to close the process and open it again manually and then it starts to download and update the stuffs)

Thanks a lot

Epi
  • 682
  • 3
  • 10
  • 16
  • [How to create an auto startup c++ program](http://stackoverflow.com/q/557466/1888362) – Serg Jan 18 '13 at 15:24
  • The fact your process is launching suggests that the auto-start mechanism is working properly. I would add some logging or attach a debugger to see why it's just sitting there. – Kevin Richardson Apr 04 '13 at 15:42

1 Answers1

2

When you use the task scheduler, you can use admin rights; see here: http://www.techrepublic.com/blog/window-on-windows/make-vista-launch-uac-restricted-programs-at-startup-with-task-scheduler/616

Arie
  • 31
  • 5