Tuesday, March 02, 2010
This is just a very short example of writing files to a CD or DVD using C# on Windows XP. For this I will use the XP Burn Component provided by Microsoft. This is a class library that you can use from C# or any other .Net language to write files to disc, simply down load the MSI file from the XP Burn web site and follow these steps.
  1. Start Visual Studio and create a new Windows Forms Application
  2. Right click on the 'References' folder and select 'Add Reference.'
  3. Browse to the location of the XPBurnComponent.dll file, for me I had chose all the default settings during the installation options and the dll was located under 'My Documents' folder in MSDN\XPBurn. AddReference
  4. Once you have added the dll to your project you can begin using the classes it contains by adding a using directive for the XPBurn namespace


    using XPBurn;



  5. Writing files to the disc is now very easy al you have to do is create an instance of XPBurnCD, call the AddFile method to add files to the disc and the RecordDisc method to actually write the files to the disc. This sample method shows adding files in a directory and writing these to disc.



    XPBurnCD cd = new XPBurnCD(); cd.BurnComplete += new NotifyCompletionStatus(BurnComplete); MessageBox.Show(cd.BurnerDrive); DirectoryInfo dir = new DirectoryInfo(_burnFolder); foreach (FileInfo file in dir.GetFiles()) { cd.AddFile(file.FullName, file.Name); } cd.RecordDisc(false, false);

 

The XPBurnCD class has a number of events that you can use to monitor the progress of the burn process. In the above example I have used the NotifyCompletionStatus so that I can display a message to the user when all the files have been written to the disc. For more information on the classes, methods and properties that XPBurn has take a look at the help file 'XPBurnDocs.chm' which is installed in the same directory as 'XPBurnComponent.dll'.

You can download my Visual Studio 2010 sample application

posted on Tuesday, March 02, 2010 9:23:08 PM (GMT Standard Time, UTC+00:00)  #    Add Comment | Comments [0]
 Thursday, November 05, 2009

I've had a few questions regarding uninstalling Windows PowerShell 1.0 on XP to make way for PowerShell 20. It's actually quiet simple although not immediately obvious. PowerShell doesn't show up under Add/Remove programs as it's counted as a Windows update so follow these steps it you want to uninstall it.

    1. Click Start -> Run
    2. Type appwiz.cpl and press enter
    3. Windows PowerShell will not show up in the list of programs as it is counted as a windows update, you must click the tick box "Show updates"
    4. Scroll down and look for "Windows XP - Software Updates"
    5. Underneath the Windows XP -Software updates entry is a list of all updates that have been applied to you machine scroll through the list and you will find an entry call "Windows PowerShell(TM) 1.0"
    6. Click the "Remove" button to begin uninstalling PowerShell 1.0

 Screen showing Add Remove PowerShell

 

You can find more details on this in the Microsoft knowledgebase at:  http://support.microsoft.com/kb/926139

posted on Thursday, November 05, 2009 8:33:13 PM (GMT Standard Time, UTC+00:00)  #    Add Comment | Comments [2]
 Monday, October 19, 2009

I've just written a Windows Shell extension for XP that gives some of the functionality that 'Copy as Path' provides on Vista/7/2008. If your like me and unlucky enough to still be using XP at work maybe you should check it out on codeplex. Please leave any feedback on codeplex and I'll try and incorporate it into future builds if at all possible.

Although not needed since Vista I'll try and maintain builds of this for newer versions of Windows as the Application code is very simple and the code could therefore be useful to anyone else learning to write shell extensions.

posted on Monday, October 19, 2009 7:20:40 PM (GMT Standard Time, UTC+00:00)  #    Add Comment | Comments [0]