Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 19th, 2006, 6:51 PM   #1
master1223
Newbie
 
Join Date: Mar 2006
Posts: 1
Rep Power: 0 master1223 is on a distinguished road
auto run

does anyone know how to make a program run automatically(which is stored on a removable device) , when that device is pluged into the computer. im pretty new to c programming but have a background in other languages. i was just wondering this for a project i was thikning about,, thanks for any feedback
master1223 is offline   Reply With Quote
Old Mar 20th, 2006, 4:42 AM   #2
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
What kind of storage device? On Windows a lot of people have their CD auto play, but one can turn that off. If they have it on, then there is an ini file which you can use, it's called autorun.inf, which tells the computer which program to run.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Mar 20th, 2006, 10:19 AM   #3
coldDeath
Expert Programmer
 
coldDeath's Avatar
 
Join Date: Aug 2005
Location: UK
Posts: 862
Rep Power: 4 coldDeath is on a distinguished road
Send a message via AIM to coldDeath Send a message via Yahoo to coldDeath
Yeah a good way for Windows is what nnxion said.

If the programs executable is on a CD or other storage device, create a file named autorun.inf in its top level directory.

The autorun.inf should contain this text:

[autorun]
open=YourProgram.exe
icon=YourIcon.ico

That is only a basic file, and it can be changed a lot. Check out a tutorial (use google to find one) for more advanced stuff

~Cold
__________________
Join us at #programmingforums @ irc.freenode.net!

My software never has bugs. It just develops random features.
coldDeath is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:21 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC