hi
i need help

i want away to create aprogramme using C# that when i connect my USB flash to my computer it automaticaly run another .exe c# exist on my USB flash, how can i write aprogramme do that?

if any one have an idea please help me

Many Thanks,

Recommended Answers

All 7 Replies

That's not so much a C# question as it is one of Windows file management. Check out this information on AutoRun:

http://msdn2.microsoft.com/en-us/library/bb776823.aspx

i want solution for making a USB Flash (Removable) Disk to run a file (such as AUTORUN.INF) automatically. this way does not work with USB Flash (Removable) Disk it work with CD-ROM only. i want to make it with USB Flash if you have suggestions

Many Thanks,

Re:How to create autostart of program using C#?

I want that when the computes turn's on program automatically start working.(like the "Skype" or Antivirus).

many thx.

try saving a file AUTORUN.INI, not .INF with the following lines of code:

[autorun]
open=ProgramName.exe

and after that u can for ex.: change the attribute to the files so they wouldn't be visible, or even add an icon to the usb drive by ading the folowing in AUTORUN.INI

icon=icon.ico   or   icon=ProgramName.exe

this works believe me.

Mark it as solved if it did work ;)

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.