Cannot copy certain files...?

tonycrew

Well-known member
Joined
Apr 20, 2009
Messages
55
Programming Experience
Beginner
Hi we have some code that will remove certain files from certain directories, but we also have a backup option as well.
During the backup we sometimes get an error.
IOExxception was unhandled
Here's the code
VB.NET:
 If CheckBox7.Checked = True Then
                If My.Computer.FileSystem.FileExists(TextBox104.Text & "\Settings\" & ComboBox65.Text & ".ini") Then
                    My.Computer.FileSystem.CopyFile(TextBox104.Text & "\Settings\" & ComboBox65.Text & ".ini", meDirectory & "\Stored Backup Files\Theme Backup\" & ComboBox65.Text & "\Settings\" & ComboBox65.Text & ".ini", True)
                End If
            End If
            If CheckBox6.Checked = True Then
                If My.Computer.FileSystem.DirectoryExists(TextBox104.Text & "\Media\" & ComboBox65.Text) Then
                    My.Computer.FileSystem.CopyDirectory(TextBox104.Text & "\Media\" & ComboBox65.Text, meDirectory & "\Stored Backup Files\Theme Backup\" & ComboBox65.Text & "\Media\" & ComboBox65.Text & "\", True)
                End If
            End If
            If CheckBox5.Checked = True Then
                If My.Computer.FileSystem.DirectoryExists(TextBox104.Text & "\Databases\" & ComboBox65.Text) Then
                    My.Computer.FileSystem.CopyDirectory(TextBox104.Text & "\Databases\" & ComboBox65.Text, meDirectory & "\Stored Backup Files\Theme Backup\" & ComboBox65.Text & "\Databases\" & ComboBox65.Text & "\", True)
                End If

Settings.ini is a single file
Media is a folder
Databases is a folder.

Now it copies all the files but doesnot copy the following
Star Wars - Return of the Jedi - Death Star Battle (USA).png
Star Trek - Strategic Operations Simulator (USA).png
Montezuma's Revenge featuring Panama Joe (USA).png
David Crane's Pitfall II - Lost Caverns (USA).png

When i rename David Crane's Pitfall II - Lost Caverns (USA).png to David Crane's Pitfal.png it copies it to the backup directory, but this is not an option for me to rename files as this has to make a backup on other peoples computer.

If it is the filename legth is there anyway around this...?

Any ideas please...?
 
Back
Top