So what do you think? 5 Goodie bags available!
HJoyce
Posts: 186
Is it is user-friendly?
Does it have all the features you require?
How much of an improvement is it to have a GUI rather than using the command line utility?
Post your feedback in order to qualify for a red gate goodie bag!
Does it have all the features you require?
How much of an improvement is it to have a GUI rather than using the command line utility?
Post your feedback in order to qualify for a red gate goodie bag!
Helen Joyce
SQL Backup Project Manager
Red Gate Software
SQL Backup Project Manager
Red Gate Software
Comments
Thanks!
You can use the MS-DOS FOR command to repeat command-line tasks that don't accept wildcards, for example:
Don't know why I didn't think of that earlier. Just had to make a slight tweak in order to make it work:
Set Command = WScript.CreateObject("WScript.Shell")
cmd = "for %i in (e:\sqlbackup\*.sqb) do "C:\program files\red gate\sql backup\sqb2mtf.exe" "%i" "%i.mtf""
Command.Run (cmd)
If I was doing this in VB, I would dispense with the FOR command, and use Scripting.FileSystemObject to create a folderobject and enumerate the collection of files, running the command on each file.
I am new to vbscript and was able create code to move sqb files from one directory to another. The plan is then to convert files to *.MTF so we can use AuditDB. Can you look at this code and suggest how to call sqbmtf.exe.
code below.
===========================================
Option Explicit
Dim fileCount
Const fromDir = "G:\EPDMS01\BACKUP01\Log"
Const toDir = "G:\EPDMS01\BACKUP01\Misc"
fileCount = CopyFile(CreateObject("Scripting.FilesystemObject"), fromDir, toDir)
On Error Resume Next
WScript.StdOut.WriteLine "Copied " & fileCount & " files."
WScript.Quit fileCount
'oFSO (object) - FileSystemObject to use
'sStart (string) = Source directory
'sEnd (string) - Destination directory
Function CopyFile(oFSO, sStart, sEnd) 'As Integer
Dim d, f, i, ext
If Right(sEnd, 1) <> "\" Then _
sEnd = sEnd & "\"
If Not oFSO.FolderExists(sEnd) Then _
oFSO.CreateFolder sEnd
With oFSO.GetFolder(sStart)
For Each f In .Files
ext = oFSO.GetExtensionName(f)
If Len(ext) And InStr(1, "sqb", ext, 1) And _
ShouldCopy(oFSO, sEnd & f.Name, f.DateLastModified) Then
f.Copy sEnd
i = i + 1
End If
Next 'f
For Each d In .SubFolders
i = i + CopyFile(oFSO, d, sEnd & d.Name & "\")
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "G:\Program Files\Red Gate\sqb2mtf.exe G:\EPDMS01\BACKUP01\Misc\*.sqb G:\EPDMS01\BACKUP01\Misc\*.mtf"
Next 'd
End With
CopyFile = i
End Function
'oFSO (object) - FileSystemObject
'sFile (string) - File (w/ path)
'dCutoff (date) - Date to compare to file's date.
Function ShouldCopy(oFSO, sFile, dCutoff) 'As Boolean
With oFSO
If Not .FileExists(sFile) Then
ShouldCopy = True
Exit Function
End If
ShouldCopy = .GetFile(sFile).DateLastModified < dCutoff
End With
End Function