diff --git a/DICUI.Library/Utilities/Drive.cs b/DICUI.Library/Utilities/Drive.cs index 3bd90358..594a99cd 100644 --- a/DICUI.Library/Utilities/Drive.cs +++ b/DICUI.Library/Utilities/Drive.cs @@ -30,17 +30,19 @@ namespace DICUI.Utilities { get { + string volumeLabel = Template.DiscNotDetected; if (DriveInfo.IsReady) { if (string.IsNullOrWhiteSpace(DriveInfo.VolumeLabel)) - return "track"; + volumeLabel = "track"; else - return DriveInfo.VolumeLabel; - } - else - { - return Template.DiscNotDetected; + volumeLabel = DriveInfo.VolumeLabel; } + + foreach (char c in Path.GetInvalidFileNameChars()) + volumeLabel = volumeLabel.Replace(c, '_'); + + return volumeLabel; } }