anyone know how to add your program to start up on windows xp/vista and regardless of user admin guest or normal user...any bit of source code available will be helpful..

>and regardless of user admin guest or normal user...
This is a suspicious clause. A benign program would be comfortable simply accepting expected restrictions for installation tasks that require elevated privileges. Presumably you know how to set your program as one of the startup applications when those restrictions are in place, and you want to subvert the security of the system, which is why you're asking the question.

Am I wrong?

>and regardless of user admin guest or normal user...
This is a suspicious clause. A benign program would be comfortable simply accepting expected restrictions for installation tasks that require elevated privileges. Presumably you know how to set your program as one of the startup applications when those restrictions are in place, and you want to subvert the security of the system, which is why you're asking the question.

Am I wrong?

if my intentions were to subvert or take over the security of the system well then your wrong but is there anyway of adding the program to the start up on a normal user (non-root privileges)?

Assuming this is a regular application rather than a service, you can simply copy it to the start menu startup folder for that user. IIRC, users have full control over their startup folders (in XP at least).

well is there any other way through the registry for example or by using win32 API???

sorry for double posting but problem solved!!!

#include <windows.h>

int main(void)
{
    TCHAR szPath[MAX_PATH];
 
    GetModuleFileName(NULL,szPath,MAX_PATH);

    HKEY newValue;

    RegOpenKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",&newValue);
 
    RegSetValueEx(newValue,"name_me",0,REG_SZ,(LPBYTE)szPath,sizeof(szPath));

    RegCloseKey(newValue);

    return 0;
}

that's just the code to add to start up on the any kind of account thank you all for your help ^_^

I don't like apps on Local Machine, I prefer User.

He could always just add a shortcut in the startup folder in the all users start menu, or set it as a logon script (logon script may be better as it could be set for all machines on a domain for example)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.