Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 7th, 2008, 03:11 PM
wjarrett's Avatar
wjarrett wjarrett is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Idaho
Posts: 101 wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 8 h 24 m 52 sec
Reputation Power: 24
I need a little help with using VB to burn files to a CD (Unattended).

I have established a resource library on my server.
I am creating a vb application to act as a simple User Interface to make it
easier for my customers to get the resources they want.

I would like for them to click an action button and for the following
events to occur:


1) CD Tray opens and prompts user to put a blank CD in the tray (got that figured out)

Code:
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _
(ByVal lpCommandString As String, ByVal lpReturnString As String, _
ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim retval As Long
retval = mciSendString("set CDAudio door open", "", 0, 0)
MsgBox("Please insert a blank CD, and close the CD Tray")

End Sub



2) When the CD tray closes, Open a cd burn list

3) Goto the following directory-

\\Clfiledept\sheriff\Training Section\Admin, Training Section\Backup CD\Course CD's\Big Rigs

4) Add all the files and folders from inside the Big Rigs folder to the CD burn list

(types of files associated with these folders will be ; swf, jpg, wav, asf, wmv, exe, x32, inf, a5r, u32, txt) 96.7 mb of data

5) Burn the CD

6) Eject the CD, and display message the CD is burned and ready to use.


Not quite sure how to proceed from here.....

Reply With Quote
  #2  
Old July 10th, 2008, 01:00 AM
wjarrett's Avatar
wjarrett wjarrett is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Idaho
Posts: 101 wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level)wjarrett User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 8 h 24 m 52 sec
Reputation Power: 24
Found an acceptable workaround

3 days of digging and researching have led me to conclude there is no good way to do want I want from VB. This is the closest
workaround I could come up with. It seems to work, so I am happy at this point.



Code:
Public Class Form1
    Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _
    (ByVal lpCommandString As String, ByVal lpReturnString As String, _
    ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim Uservalue As String
        Uservalue = SystemInformation.UserName

        Dim retval As Long
        retval = mciSendString("set CDAudio door open", "", 0, 0)

        MsgBox("Please insert a blank CD, and close the CD Tray" & vbCrLf & _
               "The process of burning the CD may take a few minutes", _
               MsgBoxStyle.OkOnly, "Click OK to Continue")

My.Computer.FileSystem.CopyDirectory("D:\Folder1\Folder2\Folder3\TestRun", _
"C:\Documents and Settings\" & Uservalue & _
"\Local Settings\Application Data\Microsoft\CD Burning", True)

        ’  (“Source Directory", "Destination Directory", True)
        ’   CD Burn Folder Directory is: "C:\Documents and Settings\" & Uservalue & _
        ’  "\Local Settings\Application Data\Microsoft\CD Burning"

    End Sub
  
End Class



The paths and files that are copied in my case are known fixed locations, I just had to come up with a way to automate the whole delivery process.

When a user wants a Course on CD, he just clicks the action button and it opens the CD tray, says feed me, closes the tray and clicks OK. The program finds the directory I want copied and puts the files in the burner tray. The loading of a blank cd also conveniently opens the cd burning wizard when it detects a fresh cd.

Lo and behold the files are there waiting to be written ! When it's done it ejects and clears the burn tray list.

Please Note the Variable "Uservalue" which is specified in the destination path of where the temp files are written to. The CD burning utility stores the to be burned files in a folder within the profile of the user logged on to the computer.


Someone improve on this please as I know it can probably be done better than a guy with a weeks experience with VB.
__________________
My Heroes....
Jesus, Abraham Lincoln, General George S. Patton, Yoda, Shadow Wizard, and Meloncolly. Sorry if someone is ahead of you but they are tough acts to beat.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > I need a little help with using VB to burn files to a CD (Unattended).


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT