DIGIT-ARC read-only archive · snapshot: July 23, 2026

How to make the program start with windows?

13 posts · originally from https://geek.digit.in/community/threads/how-to-make-the-program-start-with-windows.144447/

Nipun
Nipun Original post #1
Jul 31, 2011 at 9:52 AM
I am making a program, in which I want to add an option for "Start with windows". The problem is that I dont know how to do this. I know that there is a "Startup" folder somewhere in computer, and this is what I am gonna do:
-Include a shortcut with the program.
-When Start with windows is selected, copy the shortcut.
-Paste it to startup folder.

But, the problem is what is directory of startup folder? I know its:
"C:\Documents and Settings\USER NAME\Start Menu\Programs\Startup"
But what if user name is different?

Is there any other way to access startup folder?

I am using Game Maker Language to create this, but I am sure most of you have not heard of it, so talking about it is useless.
BTW I can also access the registry, so is it possible to get the username from registry? I have never used registry from a program so, and I dont want to ruin my and user's computer-so please be exact if possible. :)
nims11
nims11 #2
Jul 31, 2011 at 10:19 AM
you can make use of the %USERPROFILE% environment variable to get the current user's directory. then the startup folder will be
%USERPROFILE%\Start Menu\Programs\Startup

or if you want to add it to the startup of all the users, use the %ALLUSERSPROFILE% environment variable.
and copy the file to %ALLUSERSPROFILE%\Start Menu\Programs\Startup
desiibond
Jul 31, 2011 at 10:32 AM
did you check C:\Documents and Settings\All users\......
Nipun
Nipun #4
Jul 31, 2011 at 10:35 AM
did you check C:\Documents and Settings\All users\......
:oops:

Its there, thanks! :D :D
But I dont think its same for Windows 7 too, is it?
nims11
nims11 #5
Jul 31, 2011 at 10:37 AM
Why don't you use registry (like most apps do).
you can add an entry to registry by creating a .reg file with the content as below and then executing it.
Code:
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"Name of the program"="Application.exe"
Nipun
Nipun #6
Jul 31, 2011 at 10:39 AM
Why don't you use registry (like most apps do).
you can add an entry to registry by creating a .reg file with the content as below and then executing it.
Code:
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"Name of the program"="Application.exe"
I have never used registry so I wanted to I avoid it.

Anyways, you saying that copy and paste the code you provided in notepad and save it as .reg file and execute it? :eek:
nims11
nims11 #7
Jul 31, 2011 at 12:24 PM
^^ yes
Nipun
Nipun #8
Jul 31, 2011 at 12:29 PM
Just a few questions:
I need not to change anything in code except "Name of program" and its directory, right?
Will this work for xp and 7 both?
nims11
nims11 #9
Jul 31, 2011 at 12:54 PM
Just a few questions:
I need not to change anything in code except "Name of program" and its directory, right?
right. you can even use environment variables in the application path.

it worked for me in XP. should work on 7 too.
Nipun
Nipun #10
Jul 31, 2011 at 3:08 PM
This is how I exactly did it:
Created a .reg file with exactly this:
Code:
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"antimali"="D:\GM8 Stuff\AntiMali\Crylla-Degree SCAN\antimali.exe"
Executed it(double clicked, for testing)
Restarted the computer.
Nothing happened! :(

Am I supposed to do it in a different way?

you can make use of the %USERPROFILE% environment variable to get the current user's directory. then the startup folder will be
%USERPROFILE%\Start Menu\Programs\Startup

or if you want to add it to the startup of all the users, use the %ALLUSERSPROFILE% environment variable.
and copy the file to %ALLUSERSPROFILE%\Start Menu\Programs\Startup
NEVERMIND! I overlooked this post. Using this I am able to achieve it, thanks! :D :D
v.Na5h
v.Na5h #11
Jul 31, 2011 at 3:19 PM
Task Scheduler....[Full stop]

Goto help topics ...if u need help regarding it
nims11
nims11 #12
Jul 31, 2011 at 4:32 PM
@nipun in the .reg file, you need to give the application's executable and not the directory.
gagan007
gagan007 #13
Aug 1, 2011 at 11:13 AM
you may also try to execute the program as a windows service. it is not difficult to achieve that either. let me know if you need more help on this.
if you have attained your goal using
%ALLUSERSPROFILE%\Start Menu\Programs\Startup
, it is fine..