Register Autostart Application


/ Published in: C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. //nfilename: the path to the application
  2. //keyname: the name to appear in the registery
  3. void AutoStartRegs(char *nfilename, char *keyname)
  4. {
  5. HKEY key;
  6.  
  7. RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &key, NULL);
  8. RegSetValueEx(key, keyname, 0, REG_SZ, (const unsigned char *)nfilename, strlen(nfilename));
  9. RegCloseKey(key);
  10.  
  11. return;
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.