473,387 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Making an Autorun DVD

programingguru
Hello I am M. Sullivan II



Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
  3.         Process.Start(C:\"Resources\w2ksp2.exe")
  4.     End Sub
  5.  
This path and file are on my computer.I am trying to build this with Visual Studio 2005. I am running Windows XP.I have heard of a Autorun CD creator and might try it.


My question is my DVDROM drive path letter is f. but I want it to find the files on the DVDROM drive in other computer. This way I run the Autorun DVD in another computer the DVDRON drive will search for that drive letter. The drive path is different in other computers. Based on OS.

All I am trying to do is create a Service pack DVD.
For my computer.

Thanks for any help on this project
May 19 '18 #1
1 1881
IronRazer
83 64KB
An "AutoRun" is just a simple text file that is saved in the root of the DVD or CD itself which contains the exe file you want to run when the DVD or CD is inserted. A VB.Net program would not be needed to run the exe on the DVD or CD.

You can find info on creating an AutoRun.inf file at the links below.

Msdn - Creating an AutoRun-Enabled Application
Wikipedia - Autorun.inf

However, if you actually want to run an exe on a Dvd or Cd from your vb.net application and you want your application to find the Dvd-Rom or Cd-Rom which contains the exe, then you can use the DriveInfo Class to do that.

You can iterate through all the drives that are CD/DVD types and look for the filename of your exe file on them. For example...
Expand|Select|Wrap|Line Numbers
  1.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  2.         For Each di As IO.DriveInfo In IO.DriveInfo.GetDrives 'iterate through all the drives avaiable
  3.             If di.IsReady AndAlso di.DriveType = IO.DriveType.CDRom Then 'check if the drive is ready and it is a CDRom type
  4.                 Dim ExeToFind As String = IO.Path.Combine(di.Name, "MyExeFile.exe") 'combine the drive letter with the filename of your specific exe file
  5.                 If IO.File.Exists(ExeToFind) Then 'check if your exe file exists on this CD/DVD
  6.                     Process.Start(ExeToFind) 'start the exe
  7.                     Exit For 'exe was found and started so, no need to keep looking, exit the loop
  8.                 End If
  9.             End If
  10.         Next
  11.     End Sub
  12.  
Or using the Where extension method...
Expand|Select|Wrap|Line Numbers
  1.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  2.         Dim drive As IO.DriveInfo = IO.DriveInfo.GetDrives.Where(Function(di) di.IsReady AndAlso di.DriveType = IO.DriveType.CDRom AndAlso IO.File.Exists(di.Name & "MyExe.exe")).FirstOrDefault
  3.         If drive IsNot Nothing Then
  4.             Process.Start(drive.Name & "MyExe.exe")
  5.         End If
  6.     End Sub
  7.  
Jun 1 '18 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: M.E.Farmer | last post by:
Hello all, I needed this and did a quick search around and didn't see any examples. I knew it had to be easy, and it was. So here it is a CD_Autorun program in python. It is very simple and...
1
by: zacks | last post by:
Is there any way in VB code to tell if an application was invoked from an Autorun.INF file on a CD/DVD or if it was invoked from the Start Menu (or a shortcut)?
2
by: Joe Cool | last post by:
I know this is probably not the proper newsgroup to ask this question, but I do not know which one is. And most of you guys here know a lot about windows programming so I am taking a chance some...
2
by: tmWin | last post by:
Hi all I wanna run my application directly from a Flash Disk. I want it AUTORUN once the device is attached. I have seen some virus script-programs which create their own autoruns on a...
5
by: Orv | last post by:
I have a database set up where I want to export the records to a cd. I want to be able to create an autorun cd and have it based on HTML so when it opens, the user can click on various links and it...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: Overview NOTE- This complete article on "Windows Autorun FAQs" applies theoretically to all Windows NT-based OSes till Windows Vista (and probably Vista's successors too)....
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: Description NOTE- If you are unfamiliar with the concept of autoruns, then read "Windows Autorun FAQs: Overview". Que-1: How can I safely remove or edit the autorun...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: Programs dealing with autoruns Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list programs that help me to view/modify the autoruns...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.