Forum     

Go Back   Digit Technology Discussion Forum > Software > Software Q&A
Register FAQ Calendar Mark Forums Read

Software Q&A Having trouble with software? Find solutions here


Reply
 
LinkBack Thread Tools Display Modes
Old 31-07-2011, 09:52 AM   #1 (permalink)
Whompy Whomperson
 
Nipun's Avatar
 
Join Date: Mar 2011
Location: New Delhi
Posts: 1,033
Default How to make the program start with windows?


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.
__________________
¯_¯_¯_¯_¯_¯_ Yes, I am stupid. ¯_¯_¯_¯_¯_¯_
Need some suggestions/comments:
▒▒ Team Fortress 2 Comic Maker ▒▒
Nipun is online now   Reply With Quote
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 31-07-2011, 10:19 AM   #2 (permalink)
BIOS Terminator
 
nims11's Avatar
 
Join Date: Apr 2008
Location: Ranchi
Posts: 819
Default Re: How to make the program start with windows?

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
nims11 is online now   Reply With Quote
Old 31-07-2011, 10:32 AM   #3 (permalink)
Bond, Desi Bond!
 
desiibond's Avatar
 
Join Date: Oct 2007
Location: Bangalore
Posts: 10,035
Default Re: How to make the program start with windows?

did you check C:\Documents and Settings\All users\......
__________________
My first blogspace: http://desiibond.blogspot.com
desiibond is offline   Reply With Quote
Old 31-07-2011, 10:35 AM   #4 (permalink)
Whompy Whomperson
 
Nipun's Avatar
 
Join Date: Mar 2011
Location: New Delhi
Posts: 1,033
Default Re: How to make the program start with windows?

Quote:
Originally Posted by desiibond View Post
did you check C:\Documents and Settings\All users\......


Its there, thanks!
But I dont think its same for Windows 7 too, is it?
__________________
¯_¯_¯_¯_¯_¯_ Yes, I am stupid. ¯_¯_¯_¯_¯_¯_
Need some suggestions/comments:
▒▒ Team Fortress 2 Comic Maker ▒▒
Nipun is online now   Reply With Quote
Old 31-07-2011, 10:37 AM   #5 (permalink)
BIOS Terminator
 
nims11's Avatar
 
Join Date: Apr 2008
Location: Ranchi
Posts: 819
Default Re: How to make the program start with windows?

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"
nims11 is online now   Reply With Quote
Old 31-07-2011, 10:39 AM   #6 (permalink)
Whompy Whomperson
 
Nipun's Avatar
 
Join Date: Mar 2011
Location: New Delhi
Posts: 1,033
Default Re: How to make the program start with windows?

Quote:
Originally Posted by nims11 View Post
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?
__________________
¯_¯_¯_¯_¯_¯_ Yes, I am stupid. ¯_¯_¯_¯_¯_¯_
Need some suggestions/comments:
▒▒ Team Fortress 2 Comic Maker ▒▒

Last edited by Nipun; 31-07-2011 at 12:28 PM.
Nipun is online now   Reply With Quote
Old 31-07-2011, 12:24 PM   #7 (permalink)
BIOS Terminator
 
nims11's Avatar
 
Join Date: Apr 2008
Location: Ranchi
Posts: 819
Default Re: How to make the program start with windows?

^^ yes
nims11 is online now   Reply With Quote
Old 31-07-2011, 12:29 PM   #8 (permalink)
Whompy Whomperson
 
Nipun's Avatar
 
Join Date: Mar 2011
Location: New Delhi
Posts: 1,033
Default Re: How to make the program start with windows?

Quote:
Originally Posted by nims11 View Post
^^ yes
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?
__________________
¯_¯_¯_¯_¯_¯_ Yes, I am stupid. ¯_¯_¯_¯_¯_¯_
Need some suggestions/comments:
▒▒ Team Fortress 2 Comic Maker ▒▒
Nipun is online now   Reply With Quote
Old 31-07-2011, 12:54 PM   #9 (permalink)
BIOS Terminator
 
nims11's Avatar
 
Join Date: Apr 2008
Location: Ranchi
Posts: 819
Default Re: How to make the program start with windows?

Quote:
Originally Posted by Nipun View Post
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.
nims11 is online now   Reply With Quote
Old 31-07-2011, 03:08 PM   #10 (permalink)
Whompy Whomperson
 
Nipun's Avatar
 
Join Date: Mar 2011
Location: New Delhi
Posts: 1,033
Default Re: How to make the program start with windows?

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?

Quote:
Originally Posted by nims11 View Post
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!
__________________
¯_¯_¯_¯_¯_¯_ Yes, I am stupid. ¯_¯_¯_¯_¯_¯_
Need some suggestions/comments:
▒▒ Team Fortress 2 Comic Maker ▒▒
Nipun is online now   Reply With Quote
Old 31-07-2011, 03:19 PM   #11 (permalink)
Off Hook!
 
v.Na5h's Avatar
 
Join Date: Nov 2009
Location: Mumbai
Posts: 180
Default Re: How to make the program start with windows?

Task Scheduler....[Full stop]

Goto help topics ...if u need help regarding it
__________________
Core i3 530 @ 2.93Ghz | Kingston 4GB (2GBx2) DDR3 1333MHz | Gigabyte GA-H55M-S2H | Acer S231HL 23" LED Monitor | Nvidia GTS 450 | Seagate Barracuda 1TB | FSP Saga II 350w | CM Elite 310 | | Philips HTS 5.1 SP100
| Zotac GTS 450 |X360 Gamepad |

Dell XCD35 powered by CM9, Soundmagic PL11 earphones, Samsung class 6 16GB

Quote:
TV Shows / Movies .....I have watched....
v.Na5h is offline   Reply With Quote
Old 31-07-2011, 04:32 PM   #12 (permalink)
BIOS Terminator
 
nims11's Avatar
 
Join Date: Apr 2008
Location: Ranchi
Posts: 819
Default Re: How to make the program start with windows?

@nipun in the .reg file, you need to give the application's executable and not the directory.
nims11 is online now   Reply With Quote
Old 01-08-2011, 11:13 AM   #13 (permalink)
Uhu, Not Gonna Happen!
 
gagan007's Avatar
 
Join Date: Nov 2005
Location: Bangalore
Posts: 1,160
Default Re: How to make the program start with windows?

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
Quote:
%ALLUSERSPROFILE%\Start Menu\Programs\Startup
, it is fine..
__________________
My personal blog - http://gagan.scholarguru.com
gagan007 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Niilesh
- by chris
- by clinton
- by abhidev
- by gforz
- by Anorion
- by Tenida
- by tkin

Advertisement




All times are GMT +5.5. The time now is 02:16 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2