On 18 Apr 2007 06:46:24 -0700, rshillington wrote:
Hi there,
Thanks for the reply. The file is definitely not open when I try to move
it. The code I use is here:
Sub MoveData()
Dim f As String = ""
Dim d As Date = DateAdd(DateInterval.Day, -1, Date.Today)
Me.Label1.Text = "Creating Directory"
f = "F:\DataBackup" & Format(d, "yyyymmdd")
Directory.CreateDirectory(f)
Me.Label1.Text = "Moving Backup Transaction Logs"
Dim filesTRN() As FileInfo = New
DirectoryInfo("G:\").GetFiles("*.TRN")
For Each file As FileInfo In filesTRN
file.MoveTo(f)
Next
Me.Label1.Text = "Moving Backup DB Files"
Dim filesBAK() As FileInfo = New
DirectoryInfo("G:\").GetFiles("*.BAK")
For Each file As FileInfo In filesBAK
file.MoveTo(f)
Next
End Sub
Thanks again.
hmmm --- Do you perhaps have the file open that you're trying to
move? Could you post a snippet of the code the reproduces the
problem? How you create the directory shouldn't matter.
Ralph Shillington
iFoundTIme Inc
http://www.ifoundtime.com/community
home of the coffee break tutorials.
--
ats@jbex
The world is my expense
The cost of my desire
Jesus blessed me with its future
And I protect it with fire
Rage Against The Machine - Sleep Now In The Fire