Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Program to run automatically in c (http://www.go4expert.com/forums/program-run-automatically-c-t28844/)

HKen 8Aug2012 07:50

Program to run automatically in c
 
hi friends,
How will the path inside the '\' before again add.:(
thanks.

Codes:
Code:

#include<stdio.h>
void main(int argc,char *argv[])
{
    char *appPath=argv[0]; /*How will the path inside the '\' before again add '\' */
    HKEY hKey;
    RegCreateKeyEx(
            HKEY_LOCAL_MACHINE,
            "Software\\Microsoft\\Windows\\CurrentVersion\\Run",
      0,
      NULL,
      REG_OPTION_NON_VOLATILE,
    KEY_ALL_ACCESS,
      NULL,
      &hKey,
      0);
    RegSetValueExA(
    hKey,
    "this demo",
    0,
    REG_SZ,
    (CONST BYTE*) appPath,
    50);
    RegCloseKey(hKey);
}


xpi0t0s 14Aug2012 12:35

Re: Program to run automatically in c
 
I don't understand the question. It makes no sense in English. Could you rephrase it?


All times are GMT +5.5. The time now is 13:55.