(view source code of createbackupscript.hta as plain text)
body {
background-color: white;
color: darkblue;
font-family: arial, sans-serif;
font-size: 12pt;
}
div#ChooseSubfolderBlock, div#ListCloudMedia, div#ListUSBMedia {
display: none;
float: right;
position: relative;
right: 0;
top: 0;
}
div#Navigate {
bottom: 25px;
float: bottom;
left: 0;
position: fixed;
width: 100%;
}
div#PathBackup {
float: left;
left: 0;
position: relative;
top: 5px;
}
input[type=button] {
color: darkblue;
/* font-weight: bold; */
height: 24px;
margin: 3px 0 3px 0;
vertical-align: middle;
width: 100px;
}
input#ButtonChooseSubfolder {
display: none;
float: right;
position: relative;
right: 0;
top: 0;
}
input#NameOfNewBackupJob {
display: none;
}
p#HelpText {
text-align: left;
width: 80%;
}
p#NavigateButtons {
width: 300px;
}
select.Right option {
text-align: right;
}
select.Wide, option {
width: 100%;
}
select#ListOfExistingJobs {
display: none;
}
select#SelectReminderInterval {
float: right;
position: relative;
right: 0;
top: 0;
}
table#TableStep2, table#TableStep3, table#TableStep4, table#TableStep5, table#TableStep6 {
display: none;
}
td {
height: 32px;
text-align: left;
vertical-align: middle;
}
/*
td, th, tr {
border: 1px solid red;
white-space: nowrap;
}
*/
td.Hidden, th.Hidden {
display: none;
visibility: collapse;
}
td.Right {
text-align: right;
}
th {
height: 32px;
text-align: left;
vertical-align: middle;
}
th.Column150 {
width: 150px;
}
th.Column200 {
width: 200px;
}
th.Column250 {
width: 250px;
}
th.Column350 {
width: 350px;
}
th.Column450 {
width: 450px;
}
tr {
vertical-align: middle;
}
tr.Borders th {
background-color: darkcyan;
border: 2px solid darkblue;
color: white;
padding: 5px 15px;
}
tr.ReallyLarge td, tr.ReallyLarge th {
font-size: 150%;
padding-bottom: 15px;
}
tr#RowOnDiskInsert {
display: none;
}
.Center {
margin-left: auto;
margin-right: auto;
text-align: center;
}
.FloatLeft {
float: left;
position: relative;
right: 0;
top: 7px;
}
.FloatRight {
float: right;
position: relative;
right: 0;
top: 0;
}
.Hidden {
display: none;
}
.Left {
text-align: center;
}
.Middle {
vertical-align: middle;
}
.Right {
text-align: right;
}
Option Explicit
' Global arrays, lists and dictionaries
Dim gvaBackupJobs, gvaCloudStorage, gvaCustomPath(4), gvaDriveTypesFSO, gvaDriveTypesWMI, gvaExistingJobBackupTypes, gvaExistingJobReminderInt, gvaExistingJobScheduleInt, gvaHelpText, gvaRemovableStorage, gvaSpecialFolders, gvaVolumeSerials
' Global booleans
Dim gvbAdvancedInstall, gvbEditExistingJob, gvbIsElevated, gvbStep1Ready, gvbStep2Ready, gvbStep3Ready, gvbStep4Ready, gvbStep5Ready, gvbStep6Ready
' Global integers
Dim gviExistingJobRetentionDays, gviExistingJobRotationNumber, gviHeight, gviInterval, gviSpaceCloudStorage, gviSpaceHDDStorage, gviSpaceNetworkStorage, gviSpaceUSBStorage, gviTotalSize, gviWidth
' Global stings
Dim gvsExistingBackupJobID, gvsExistingJobTargetDir, gvsExistingJobTargetType, gvsExistingJobTargetVol, gvsPathCloudStorage, gvsPathHDDStorage, gvsPathNetworkStorage, gvsPathUSBStorage, gvsTargetPath
' I/O Mode constants
Const ForAppending = 8
Const ForReading = 1
Const ForWriting = 2
' WMI Registry constants
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_SZ = 1
' FSO DriveType constants
Const DRIVETYPE_UNKNOWN = 0
Const DRIVETYPE_REMOVABLE = 1
Const DRIVETYPE_FIXED = 2
Const DRIVETYPE_NETWORK = 3
Const DRIVETYPE_CDROM = 4
Const DRIVETYPE_RAMDISK = 5
' BrowseFolder constant to return only file system directories
Const BROWSEFOLDER_RETURNONLYFSDIRS = 1
Const BROWSEFOLDER_EDITBOX = 16
Const BROWSEFOLDER_NEWDIALOGSTYLE = 64
' BrowseFolder start folder constants
Const BROWSEFOLDER_DESKTOP = 0
Const BROWSEFOLDER_PROGRAMS = 2
Const BROWSEFOLDER_DRIVES = 17 ' Ignored in Windows 10?
Const BROWSEFOLDER_NETWORK = 18
Const BROWSEFOLDER_NETHOOD = 19
Const BROWSEFOLDER_PROGRAMFILES = 38
Const BROWSEFOLDER_PROGRAMFILESx86 = 48
Const BROWSEFOLDER_WINDOWS = 36
' DriveType descriptions
gvaDriveTypesFSO = Split( "Unknown,Removable,Harddisk,Network,CD-ROM,RAM Disk", "," )
gvaDriveTypesWMI = Split( "Unknown,NoRootDirectory,Removable,Harddisk,Network,CD-ROM,RAM Disk", "," )
Sub CheckUpdate( )
Dim intAnswer, intButtons, lenLatestVer, strCurrentVer, strLatestver, strPrompt, strTitle, wshShell
' Change cursor to hourglass while checking for update
Document.Body.style.Cursor = "wait"
intButtons = vbYesNoCancel + vbApplicationModal + vbInformation
Set wshShell = CreateObject( "WScript.Shell" )
strCurrentVer = Split( CrBkupScr.Version )(0)
strLatestVer = TextFromHTML( "http://www.robvanderwoude.com/updates/createbackupscript.txt" )
If strCurrentVer <> strLatestver Then
On Error Resume Next
' Clear the IE cache
wshShell.Run "RUNDll32.EXE InetCpl.cpl,ClearMyTracksByProcess 8", 7, True
' Try again, read the latest version info from the web
strLatestver = TextFromHTML( "http://www.robvanderwoude.com/updates/createbackupscript.txt" )
On Error Goto 0
End If
lenLatestVer = Len( strLatestVer )
If lenLatestVer = 4 Then
If strLatestVer < strCurrentVer Then
strTitle = "Unofficial version"
strPrompt = "You seem to be using a pre-release version (" & strCurrentVer & ") of CreateBackupScript.hta." _
& vbCrLf & vbCrLf _
& "The latest official release is " & strLatestver _
& vbCrLf & vbCrLf _
& "Do you want to download the latest official release?"
intAnswer = MsgBox( strPrompt, intButtons + vbDefaultButton2, strTitle )
If intAnswer = vbYes Then
wshShell.Run "http://www.robvanderwoude.com/htaexamples.php#CreateBackupScript", 3, False
End If
End If
If strLatestVer > strCurrentVer Then
strTitle = "Old version"
strPrompt = "You are using version " & strCurrentVer & " of CreateBackupScript.hta." _
& vbCrLf & vbCrLf _
& "The latest official release is " & strLatestver _
& vbCrLf & vbCrLf _
& "Do you want to download the latest official release?"
intAnswer = MsgBox( strPrompt, intButtons, strTitle )
If intAnswer = vbYes Then
wshShell.Run "http://www.robvanderwoude.com/htaexamples.php#CreateBackupScript", 3, False
End If
End If
Else
strTitle = "Update Check Failure"
strPrompt = "Unable to check for updates." _
& vbCrLf & vbCrLf _
& "Do you want to ""manually"" check for updates now?"
intAnswer = MsgBox( strPrompt, intButtons, strTitle )
If intAnswer = vbYes Then
wshShell.Run "htaexamples.php#CreateBackupScript", 3, False
End If
End If
Set wshShell = Nothing
' Change cursor back to default
Document.Body.style.Cursor = "default"
End Sub
Function GB( myBytes, myDigits )
Dim objOption
If myBytes = "" Then
GB = ""
ElseIf myDigits = 0 Then
' Left aligned unpadded output
GB = CLng( myBytes / ( 1024 * 1024 * 1024 ) ) & " GB"
Else
' Right aligned padded output
GB = Right( Space( myDigits ) & CLng( myBytes / ( 1024 * 1024 * 1024 ) ), myDigits ) & " GB"
End If
End Function
Sub GenerateHelpText( )
Set gvaHelpText = CreateObject( "Scripting.Dictionary" )
gvaHelpText.Item( "Step1" ) = "Choose Basic or Advanced installation.<br /><br />In most cases, the Basic installation will suffice.<br /><br />Use Advanced install only if you want to edit a backup job created earlier, or if you want to backup to a UNC path (unmapped network drive)."
gvaHelpText.Item( "Step2Basic" ) = "Edit the name of the new backup job and click ""Next""."
gvaHelpText.Item( "Step2Advanced" ) = "Create a new backup job or use an existing backup job created earlier.<br /><br />If you choose to create a new backup job, edit its name and continue.<br /><br />If you choose to edit an existing backup job, select the backup job you want to edit from the dropdown list and continue."
gvaHelpText.Item( "Step2AdvancedNew" ) = "Edit the name of the new backup job and click ""Next""."
gvaHelpText.Item( "Step2AdvancedExisting" ) = "Select the backup job you want to edit from the dropdown list and continue."
gvaHelpText.Item( "Step3Basic" ) = "Check the folders you want to backup, uncheck those you do not want to backup.<br /><br />Click ""Add"" to add up to 4 extra folders."
gvaHelpText.Item( "Step3Advanced" ) = "Check the folders you want to backup, uncheck those you do not want to backup.<br /><br />Click ""Add"" to add up to 4 extra folders.<br /><br />Check ""Show full paths..."" to display the full path of the selected folders."
gvaHelpText.Item( "Step4" ) = "Select the type of backup medium you want to save your backups to."
gvaHelpText.Item( "Step4Cloud" ) = "Select which cloud storage you want to use."
gvaHelpText.Item( "Step4HDD" ) = "Select which local harddisk storage you want to use."
gvaHelpText.Item( "Step4Network" ) = "Select which network storage you want to use."
gvaHelpText.Item( "Step4USB" ) = "Select which removable device you want to use."
gvaHelpText.Item( "Step4Subfolder" ) = "Select an optional subfolder to save the backups to."
gvaHelpText.Item( "Step5" ) = "Check all the options that you want to use.<br /><br />If you select Scheduled, choose an interval and time for the scheduled backups."
gvaHelpText.Item( "Step6" ) = "Choose what to do if a backup is missed or overdue."
End Sub
Function GetAvailableSpace( myPath )
Dim objFSO, strDrive
GetAvailableSpace = -1
On Error Resume Next
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
strDrive = objFSO.GetDriveName( myPath )
GetAvailableSpace = objFSO.GetDrive( strDrive ).AvailableSpace
Set objFSO = Nothing
On Error Goto 0
End Function
Sub GetDropbox( )
' Check if Dropbox is installed (http://www.dropbox.com)
Dim blnDropbox
Dim objFile, objFSO, objMatch, objMatches, objRE, objSubMatch, wshShell
Dim strConfigFile, strConfigText, strKey, strValue
blnDropbox = False
strConfigFile = ""
Set wshShell = CreateObject( "WScript.Shell" )
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
Set objRE = New RegExp
objRE.Global = True
objRE.IgnoreCase = True
On Error Resume Next
strTest = wshshell.RegRead( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Dropbox\DisplayName" )
If Err Then
strTest = wshshell.RegRead( "HKEY_LOCAL_MACHINE\Wow6432Node\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Dropbox\DisplayName" )
If Not Err Then blnDropbox = True
Else
blnDropbox = True
End If
On Error Goto 0
If blnDropbox Then
If objFSO.FileExists( wshShell.ExpandEnvironmentStrings( "%APPDATA%\Dropbox\info.json" ) ) Then
strConfigFile = wshShell.ExpandEnvironmentStrings( "%APPDATA%\Dropbox\info.json" )
ElseIf objFSO.FileExists( wshShell.ExpandEnvironmentStrings( "%LOCALAPPDATA%\Dropbox\info.json" ) ) Then
strConfigFile = wshShell.ExpandEnvironmentStrings( "%LOCALAPPDATA%\Dropbox\info.json" )
End If
If strConfigFile <> "" Then
Set objFile = objFSO.OpenTextFile( strConfigFile, ForReading )
strConfigText = objFile.ReadAll( )
objFile.Close
Set objFile = Nothing
objRE.Pattern = "\""(business|personal)\"":\s*{"
If objRE.Test( strConfigText ) Then
strKey = ""
strValue = ""
Set objMatches = objRE.Execute( strConfigText )
For Each objMatch In objMatches
For Each objSubMatch In objMatch.Submatches
strKey = objSubMatch
Next
Next
If strKey <> "" Then
objRE.Pattern = "\""(" & strKey & ")\"":\s*{[^}]*\""path\"":\s*\""([^\""]+)\"""
strKey = "Dropbox (" & strKey & ")"
If objRE.Test( strConfigText ) Then
Set objMatches = objRE.Execute( strConfigText )
For Each objMatch In objMatches
For Each objSubMatch In objMatch.Submatches
strValue = objSubMatch
strValue = Replace( strValue, "\.", "." )
strValue = Replace( strValue, "\(", "(" )
strValue = Replace( strValue, "\)", ")" )
strValue = Replace( strValue, "\+", "+" )
strValue = Replace( strValue, "\-", "-" )
strValue = Replace( strValue, "\\", "\" )
Next
Next
End If
gvaCloudStorage.Item( strKey ) = strValue
End If
End If
End If
End If
On Error Goto 0
Set objRE = Nothing
Set objFSO = Nothing
Set wshShell = Nothing
End Sub
Sub GetGoogleDrive( )
' Based on code found at http://stackoverflow.com/a/13703215
Dim objConfigFile, objFSO, objMatch, objMatches, objSubMatch, objRE, wshShell
Dim strConfigFile, strConfigText, strKey, strValue
strKey = "Google Drive"
strValue = ""
Set wshShell = CreateObject( "WScript.Shell" )
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
strConfigFile = wshShell.ExpandEnvironmentStrings( "%LOCALAPPDATA%\Google\Drive\sync_config.db" )
If objFSO.FileExists( strConfigFile ) Then
Set objConfigFile = objFSO.OpenTextFile( strConfigFile, ForReading )
strConfigText = objConfigFile.ReadAll( )
objConfigFile.Close
Set objConfigFile = Nothing
Set objRE = New RegExp
objRE.Global = True
objRE.IgnoreCase = True
objRE.Pattern = "local_sync_root_pathvalue[^a-z]*([a-z]:\\[\w_-\.\\]+)"
If objRE.Test( strConfigText ) Then
Set objMatches = objRE.Execute( strConfigText )
For Each objMatch In objMatches
For Each objSubMatch In objMatch.Submatches
If objFSO.FolderExists( objSubMatch ) Then
strValue = objSubMatch
End If
Next
Next
If strValue <> "" Then
gvaCloudStorage.Item( strKey ) = strValue
End If
End If
Set objMatches = Nothing
Set objRE = Nothing
End If
Set objFSO = Nothing
Set wshShell = Nothing
End Sub
Sub GetSkyDrive( )
' Based on code found at http://stackoverflow.com/a/13703215
Dim objFSO, strFolder, strKey, strRegVal, wshShell
Set wshShell = CreateObject( "WScript.Shell" )
On Error Resume Next
strRegVal = "HKEY_CURRENT_USER\Software\Microsoft\SkyDrive\UserFolder"
strFolder = wshShell.RegRead( strRegVal )
If Not Err Then
If Trim( " " & strFolder ) <> "" Then
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
If objFSO.FolderExists( strFolder ) Then
strKey = "SkyDrive (OneDrive)"
gvaCloudStorage.Item( strKey ) = strValue
End If
Set objFSO = Nothing
End If
End If
On Error Goto 0
Set wshShell = Nothing
End Sub
Sub GetSync( )
' Check if Sync is installed (http://www.sync.com)
Dim blnSyncFolderFound, blnSyncInstalled
Dim objConfigFile, objFile, objFSO, objMatches, objMatch, objRE, objSubMatch, wshShell
Dim strConfigFile, strConfigFolder, strConfigText, strInstallDir, strKey, strRegVal, strValue
blnSyncInstalled = False
Set wshShell = CreateObject( "WScript.Shell" )
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
On Error Resume Next
strRegVal = "HKEY_LOCAL_MACHINE\SOFTWARE\Sync.com\Conf\installdir"
strInstallDir = wshShell.RegRead( strRegVal )
If Err Then
strRegVal = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Sync.com\Conf\installdir"
strInstallDir = wshShell.RegRead( strRegVal )
If Not Err Then
blnSyncInstalled = True
End If
Else
blnSyncInstalled = True
End If
On Error Goto 0
If Trim( " " & strInstallDir ) = "" Then
blnSyncInstalled = False
Else
If Not objFSO.FolderExists( strInstallDir ) Then blnSyncInstalled = False
End If
If blnSyncInstalled Then
blnSyncFolderFound = False
strKey = "Sync.com"
strConfigFolder = wshShell.ExpandEnvironmentStrings( "%LOCALAPPDATA%\Sync.logs\" )
With objFSO
For Each objFile In .GetFolder( strConfigFolder ).Files
If Not blnSyncFolderFound Then
If Left( LCase( .GetFileName( objFile.Path ) ), 15 ) = "sync-worker.log" Then
strConfigFile = objFile.Path
strConfigText = ""
Set objConfigFile = .OpenTextFile( strConfigFile, ForReading, False )
strConfigText = objConfigFile.ReadAll( )
objConfigFile.Close
Set objConfigFile = Nothing
If Trim( strConfigText ) <> "" Then
Set objRE = New RegExp
objRE.Global = True
objRE.IgnoreCase = True
objRE.Pattern = "sharedfolder\s*=\s*([^\n\r]+)[\n\r]"
If objRE.Test( strConfigText ) Then
strValue = ""
Set objMatches = objRE.Execute( strConfigText )
For Each objMatch In objMatches
For Each objSubMatch In objMatch.Submatches
strValue = objSubMatch
Next
Next
Set objMatches = Nothing
If Not Trim( strValue ) = "" Then
strValue = Replace( strValue, "/", "\" )
If objFSO.FolderExists( strValue ) Then
gvaCloudStorage.Item( strKey ) = strValue
blnSyncFolderFound = True
End If
End If
End If
Set objRE = Nothing
End If
End If
End If
Next
End With
End If
Set objFSO = Nothing
Set wshShell = Nothing
End Sub
Function IsElevated( )
' Based on code by Denis St-Pierre
Dim intRC, wshShell
IsElevated = False
Set wshShell = CreateObject( "WScript.Shell" )
On Error Resume Next
intRC = wshShell.Run( "CMD /C OPENFILES > NUL 2>&1", 7, True )
If Err Then intRC = 1
On Error Goto 0
Set wshShell = Nothing
IsElevated = ( intRC = 0 )
End Function
Sub ListBackupMedia( )
'Dim objDrive, objFile, objFSO, objMatch, objMatches, objOption, objRE, objSubMatch, wshShell
Dim objOption, strKey
' Clear all existing choices and status information
RadioButtonBackupMediaCloud.checked = False
PathCloudStorage.innerHTML = " "
' SpaceCloudStorageGB.innerHTML = " "
SpaceCloudStorage.innerHTML = 0
RowBackupMediaCloud.style.display = "none"
DropdownCloudMedia.style.display = "none"
RadioButtonBackupMediaUSB.checked = False
PathUSBStorage.innerHTML = " "
' SpaceUSBStorageGB.innerHTML = " "
SpaceUSBStorage.innerHTML = 0
RowBackupMediaUSB.style.display = "none"
DropdownUSBMedia.style.display = "none"
RadioButtonBackupMediaHDD.checked = False
PathHDDStorage.innerHTML = " "
' SpaceHDDStorageGB.innerHTML = " "
SpaceHDDStorage.innerHTML = 0
RadioButtonBackupMediaNetwork.checked = False
PathNetworkStorage.innerHTML = " "
' SpaceNetworkStorageGB.innerHTML = " "
SpaceNetworkStorage.innerHTML = 0
' This dictionary will contain all Cloud Storage Service names (keys) and paths to shared folders (values)
Set gvaCloudStorage = Nothing
Set gvaCloudStorage = CreateObject( "Scripting.Dictionary" )
gvaCloudStorage.RemoveAll
' This dictionary will contain all Removable Media names (keys) and paths (values)
Set gvaRemovableStorage = Nothing
Set gvaRemovableStorage = CreateObject( "Scripting.Dictionary" )
gvaRemovableStorage.RemoveAll
' This dictionary will contain all removable Backup Media names (keys) and volume serial numbers (values)
Set gvaVolumeSerials = Nothing
Set gvaVolumeSerials = CreateObject( "Scripting.Dictionary" )
gvaVolumeSerials.RemoveAll
' Check for cloud storage
ListCloudStorage
' Check for removable harddisks
ListUSBDrives
End Sub
Sub ListCloudStorage( )
Dim objOption, strKey
GetDropbox
GetGoogleDrive
GetSkyDrive
GetSync
DropdownCloudMedia.innerHTML = ""
If gvaCloudStorage.Count > 1 Then
Set objOption = document.createElement( "OPTION" )
objOption.Text = "-- Select a cloud storage service --"
objOption.Value = ""
DropdownCloudMedia.Add( objOption )
End If
For Each strKey In gvaCloudStorage.Keys
RowBackupMediaCloud.style.display = "table-row"
Set objOption = document.createElement( "OPTION" )
objOption.Text = strKey
objOption.Value = gvaCloudStorage.Item( strKey )
DropdownCloudMedia.Add( objOption )
Next
End Sub
Sub ListSpecialFolders( )
Dim arrKnownFolders, arrValueNames, arrValueTypes
Dim i, intLength
Dim objReg, wshShell
Dim strKey, strKeyNS, strRegPath, strValue
Set gvaSpecialFolders = CreateObject( "System.Collections.Sortedlist" )
Set wshShell = CreateObject( "WScript.Shell" )
' Get a list of special folders known by the wshShell object
arrKnownFolders = Split( "AllUsersDesktop,AllUsersStartMenu,AllUsersPrograms,AllUsersStartup,Desktop,Favorites,Fonts,MyDocuments,NetHood,PrintHood,Programs,Recent,SendTo,StartMenu,Startup,Templates", "," )
For i = 0 To UBound( arrKnownFolders )
strKey = arrKnownFolders(i)
strValue = wshShell.SpecialFolders.Item( strKey )
gvaSpecialFolders.Item( strKey ) = strValue
Next
' Find more special folders, personal, unknown to the wshShell object
Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv" )
strRegPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
objReg.EnumValues HKEY_CURRENT_USER, strRegPath, arrValueNames, arrValueTypes
For i = 0 To UBound( arrValueNames )
If arrValueTypes(i) = REG_SZ Then
strKey = arrValueNames(i)
strKeyNS = Replace( strKey, " ", "" )
strValue = ""
If Left( strKey, 1 ) <> "{" Then
If Left( strKey, 1 ) <> "!" Then
If Not gvaSpecialFolders.ContainsKey( strKeyNS ) Then
objReg.GetStringValue HKEY_CURRENT_USER, strRegPath, strKey, strValue
If trim( " " & strValue ) <> "" Then
gvaSpecialFolders.Item( strKeyNS ) = strValue
End If
End If
End If
End If
End If
Next
' Find more special folders, common, unknown to the wshShell object
strRegPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
objReg.EnumValues HKEY_LOCAL_MACHINE, strRegPath, arrValueNames, arrValueTypes
For i = 0 To UBound( arrValueNames )
If arrValueTypes(i) = REG_SZ Then
strKey = arrValueNames(i)
strKeyNS = Replace( strKey, " ", "" )
strValue = ""
If Left( strKey, 1 ) <> "{" Then
If Left( strKey, 1 ) <> "!" Then
If Not gvaSpecialFolders.ContainsKey( strKeyNS ) Then
objReg.GetStringValue HKEY_CURRENT_USER, strRegPath, strKey, strValue
If trim( " " & strValue ) <> "" Then
gvaSpecialFolders.Item( strKeyNS ) = strValue
End If
End If
End If
End If
End If
Next
If Not gvaSpecialFolders.ContainsKey( "MyDocuments" ) Then
If gvaSpecialFolders.ContainsKey( "Documents" ) Then
gvaSpecialFolders.Item( "MyDocuments" ) = gvaSpecialFolders.Item( "Documents" )
End If
End If
If Not gvaSpecialFolders.ContainsKey( "MyMusic" ) Then
If gvaSpecialFolders.ContainsKey( "Music" ) Then
gvaSpecialFolders.Item( "MyMusic" ) = gvaSpecialFolders.Item( "Music" )
End If
End If
If Not gvaSpecialFolders.ContainsKey( "MyPictures" ) Then
If gvaSpecialFolders.ContainsKey( "Pictures" ) Then
gvaSpecialFolders.Item( "MyPictures" ) = gvaSpecialFolders.Item( "Pictures" )
End If
End If
If Not gvaSpecialFolders.ContainsKey( "MyVideos" ) Then
If gvaSpecialFolders.ContainsKey( "Videos" ) Then
gvaSpecialFolders.Item( "MyVideos" ) = gvaSpecialFolders.Item( "Videos" )
End If
End If
If Not gvaSpecialFolders.ContainsKey( "MyVideos" ) Then
If gvaSpecialFolders.ContainsKey( "MyVideo" ) Then
gvaSpecialFolders.Item( "MyVideos" ) = gvaSpecialFolders.Item( "MyVideo" )
End If
End If
Set objReg = Nothing
Set wshShell = Nothing
End Sub
Sub ListUSBDrives( )
Dim colDiskPartitions, colUSBDiskDrives, colLogicalDisks, objDiskPartition, objLogicalDisk, objOption, objUSBDiskDrive, objWMIService
Dim strDeviceID, strDiskPartition, strInterface, strKey, strLogicalDisk, strModel, strQuery1, strQuery2, strQuery3, strVolumeSerial
DropdownUSBMedia.innerHTML = ""
Set objWMIService = GetObject( "winmgmts://./root/CIMV2" )
' Select all DISKS with USB or FireWire interface
strQuery1 = "SELECT * FROM Win32_DiskDrive WHERE ( InterfaceType = 'USB' OR InterfaceType = '1394' ) AND Partitions > 0"
Set colUSBDiskDrives = objWMIService.ExecQuery( strQuery1 )
For Each objUSBDiskDrive In colUSBDiskDrives
strDeviceID = objUSBDiskDrive.DeviceID
strModel = objUSBDiskDrive.Model
strInterface = objUSBDiskDrive.InterfaceType
' Link the disk's device IDs to partitions
strQuery2 = "ASSOCIATORS OF {Win32_DiskDrive.DeviceID='" & strDeviceID & "'} WHERE AssocClass=Win32_DiskDriveToDiskPartition"
Set colDiskPartitions = objWMIService.ExecQuery( strQuery2 )
For Each objDiskPartition In colDiskPartitions
strDiskPartition = objDiskPartition.DeviceID
' Link the partitions to logical drives (drive letters)
strQuery3 = "ASSOCIATORS OF {Win32_DiskPartition.DeviceID='" & strDiskPartition & "'} WHERE AssocClass=Win32_LogicalDiskToPartition"
Set colLogicalDisks = objWMIService.ExecQuery( strQuery3 )
For Each objLogicalDisk In colLogicalDisks
strLogicalDisk = objLogicalDisk.Name
strVolumeSerial = objLogicalDisk.VolumeSerialNumber
gvaRemovableStorage.Item( strModel ) = strLogicalDisk & "\"
gvaVolumeSerials.Item( strModel ) = strVolumeSerial
Next
Next
Next
If gvaRemovableStorage.Count > 1 Then
Set objOption = document.createElement( "OPTION" )
objOption.Text = "-- Select a removable drive --"
objOption.Value = ""
DropdownUSBMedia.Add( objOption )
End If
For Each strKey In gvaRemovableStorage.Keys
Set objOption = document.createElement( "OPTION" )
objOption.Text = strKey
objOption.Value = gvaRemovableStorage.Item( strKey )
DropdownUSBMedia.Add( objOption )
RowBackupMediaUSB.style.display = "table-row"
Next
End Sub
Sub MarkRedIfInsufficient( myTableCell )
Dim intAvailable, objTableCell, objTableCellGB, intRequired
Set objTableCell = document.getElementById( myTableCell )
Set objTableCellGB = document.getElementById( myTableCell & "GB" )
intAvailable = objTableCell.innerHTML
intRequired = gviTotalSize
If intAvailable <> "" Then
If CDbl( intAvailable ) < CDbl( gviTotalSize ) Then
objTableCellGB.style.color = "red"
Else
objTableCellGB.style.color = "black"
End If
End If
End Sub
Function RequiredSpace( myStartFolder )
Dim intSize, objFile, objFolder, objFSO, objSubFolder
RequiredSpace = 0
intSize = 0
On Error Resume Next
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
Set objFolder = objFSO.GetFolder( myStartFolder )
' Count total file size in folder
For Each objFile In objFolder.Files
intSize = intSize + objFile.Size
Next
' Recurse through subfolders
For Each objSubFolder In objFolder.SubFolders
intSize = intSize + RequiredSpace( objSubFolder.Path )
Next
Set objFolder = Nothing
Set objFSO = Nothing
On Error Goto 0
RequiredSpace = intSize
End Function
Function SelectFolder( myStartFolder, myPrompt )
Dim intFlags, objFolder, objShell
On Error Resume Next
SelectFolder = Null
intFlags = BROWSEFOLDER_RETURNONLYFSDIRS + BROWSEFOLDER_EDITBOX + BROWSEFOLDER_NEWDIALOGSTYLE
Set objShell = CreateObject( "Shell.Application" )
Set objFolder = objShell.BrowseForFolder( 0, myPrompt, intFlags, myStartFolder )
If IsObject( objfolder ) Then SelectFolder = objFolder.Self.Path
Set objFolder = Nothing
Set objshell = Nothing
On Error Goto 0
End Function
' Keep it simple?
Sub Step1( )
TableStep1.style.display = "block"
TableStep2.style.display = "none"
TableStep3.style.display = "none"
TableStep4.style.display = "none"
TableStep5.style.display = "none"
TableStep6.style.display = "none"
HelpText.innerHTML = gvaHelpText.Item( "Step1" )
Step1_DisplayBasicOrAdvanced
End Sub
Sub Step1_DisplayBasicOrAdvanced( )
RowStep3_ShowFullPath.style.display = "none"
If RadioBasic.checked Then
gvbAdvancedInstall = False
gvbStep1Ready = True
ElseIf RadioAdvanced.checked Then
gvbAdvancedInstall = True
gvbStep1Ready = True
RowStep3_ShowFullPath.style.display = "block"
Else
gvbAdvancedInstall = False
gvbStep1Ready = False
End If
ButtonBack.disabled = True
ButtonNext.disabled = Not gvbStep1Ready
End Sub
' Backup Job
Sub Step2( )
TableStep1.style.display = "none"
TableStep2.style.display = "block"
TableStep3.style.display = "none"
TableStep4.style.display = "none"
TableStep5.style.display = "none"
TableStep6.style.display = "none"
ButtonBack.disabled = False
ButtonNext.disabled = True
If gvbAdvancedInstall Then
HelpText.innerHTML = gvaHelpText.Item( "Step2Advanced" )
Else
HelpText.innerHTML = gvaHelpText.Item( "Step2Basic" )
End If
If gvbAdvancedInstall Then
On Error Resume Next
RowExistingJobs.style.display = "table-row"
RowExistingJobs.style.display = "block"
On Error Goto 0
Step2_ListExistingBackupJobs
Else
RowExistingJobs.style.display = "none"
RadioNewBackupJob.checked = True
End If
Step2_DisplayBackupJobs
End Sub
Sub Step2_CheckNameOfNewJob( )
Dim objOption
If RadioNewBackupJob.checked Then
If NameOfNewBackupJob.value = "New Backup Job" Then
ButtonNext.disabled = True
Else
ButtonNext.disabled = False
End If
End If
If RadioExistingBackupJob.checked Then
For Each objOption In ListOfExistingJobs.options
If objOption.selected Then
If objOption.value = "" Then
ButtonNext.disabled = True
Else
gvsExistingBackupJobID = objOption.value
ButtonNext.disabled = False
End If
End If
Next
End If
End Sub
Sub Step2_DisplayBackupJobs( )
Dim objOption
gvbEditExistingJob = RadioExistingBackupJob.checked
ButtonBack.disabled = False
If RadioNewBackupJob.checked Then
NameOfNewBackupJob.style.display = "inline"
NewBackupJobID.innerHTML = Step2_GenerateNewBackupJobID( )
ExistingBackupJobID.innerHTML = ""
If gvbAdvancedInstall Then
HelpText.innerHTML = gvaHelpText.Item( "Step2AdvancedNew" )
Else
HelpText.innerHTML = gvaHelpText.Item( "Step2Basic" )
End If
Else
NameOfNewBackupJob.style.display = "none"
NewBackupJobID.innerHTML = ""
End If
If RadioExistingBackupJob.checked Then
ListOfExistingJobs.style.display = "inline"
NewBackupJobID.innerHTML = ""
For Each objOption In ListOfExistingJobs.options
If objOption.selected Then
ExistingBackupJobID.innerHTML = objOption.value
End If
Next
If gvbAdvancedInstall Then
HelpText.innerHTML = gvaHelpText.Item( "Step2AdvancedExisting" )
Else
HelpText.innerHTML = gvaHelpText.Item( "Step2Basic" )
End If
ButtonBack.disabled = True
Else
ListOfExistingJobs.style.display = "none"
ExistingBackupJobID.innerHTML = ""
End If
Step2_CheckNameOfNewJob
End Sub
Function Step2_GenerateNewBackupJobID( )
Dim dblJobID, strJobIDHex
Step2_GenerateNewBackupJobID = ""
On Error Resume Next
dblJobID = ( ( ( ( ( Year( Now ) - 2010 ) * 12 + Month( Now ) ) * 31 + Day( Now ) ) * 24 + Hour( Now ) ) * 60 + Minute( Now ) ) * 10 + ( Second( Now ) / 6 ) ' 6 second interval
strJobIDHex = Hex( dblJobID )
If Err Then MsgBox "Error while generating the Backup Job ID", vbOKOnly + vbExclamation + vbApplicationModal, "Hex Overflow"
On Error Goto 0
Step2_GenerateNewBackupJobID = strJobIDHex
End Function
Sub Step2_ListExistingBackupJobs( )
Dim arrSubkeys, arrValueNames, arrValueTypes
Dim objOption, objReg
Dim strBackupDescr, strBackupID, strBackupJob, strRegPath
Dim objDictionary
Set gvaBackupJobs = CreateObject( "Scripting.Dictionary" )
strRegPath = "SOFTWARE\robvanderwoude.com\Backup\BackupJobs"
Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv" )
On Error Resume Next
objReg.EnumKey HKEY_CURRENT_USER, strRegPath, arrSubkeys
If Not Err And Not IsNull( arrSubkeys ) And IsArray( arrSubkeys ) Then
For Each strBackupJob In arrSubkeys
strBackupDescr = "Unnamed Backup Job"
objReg.GetStringValue HKEY_CURRENT_USER, strRegPath & "\" & strBackupJob, "Description", strBackupDescr
gvaBackupJobs.Item( strBackupJob ) = strBackupDescr
Next
End If
On Error Goto 0
Set objReg = Nothing
ListOfExistingJobs.innerHTML = ""
If gvaBackupJobs.Count > 0 Then
RadioExistingBackupJob.disabled = False
If gvaBackupJobs.Count > 1 Then
Set objOption = document.createElement( "OPTION" )
objOption.text = "-- Select a backup job --"
objOption.value = ""
ListOfExistingJobs.Add( objOption )
End If
For Each strBackupJob In gvaBackupJobs.Keys
Set objOption = document.createElement( "OPTION" )
strBackupDescr = gvaBackupJobs.Item( strBackupJob )
objOption.text = strBackupDescr & " (" & strBackupJob & ")"
objOption.value = strBackupJob
ListOfExistingJobs.Add( objOption )
Next
Else
RadioNewBackupJob.checked = True
RadioExistingBackupJob.title = "Sorry, no existing backup jobs were found"
LabelExistingBackupJob.title = "Sorry, no existing backup jobs were found"
Step2_DisplayBackupJobs
End If
End Sub
' What To Backup
Sub Step3( )
Dim blnMediaSelected, blnMediaSelectedCloud, blnMediaSelectedHDD, blnMediaSelectedNetwork, blnMediaSelectedUSB
Dim strDocuments, strMusic, strPictures, strVideos
TableStep1.style.display = "none"
TableStep2.style.display = "none"
TableStep3.style.display = "block"
TableStep4.style.display = "none"
TableStep5.style.display = "none"
TableStep6.style.display = "none"
If gvbAdvancedInstall Then
HelpText.innerHTML = gvaHelpText.Item( "Step3Advanced" )
Else
HelpText.innerHTML = gvaHelpText.Item( "Step3Basic" )
End If
ButtonBack.disabled = True
ButtonNext.disabled = True
strDocuments = gvaSpecialFolders.Item( "MyDocuments" )
strMusic = gvaSpecialFolders.Item( "MyMusic" )
strPictures = gvaSpecialFolders.Item( "MyPictures" )
strVideos = gvaSpecialFolders.Item( "MyVideo" )
If IsNull( strDocuments ) Then
document.getElementById( "CheckboxIncludeDocuments" ).checked = False
Else
' PathDocuments.innerHTML = strDocuments
' window.setTimeout "Step3_ShowSize """ & strDocuments & """, ""SizeDocuments""", 1000, "VBScript"
End If
If IsNull( strMusic ) Then
document.getElementById( "CheckboxIncludeMusic" ).checked = False
Else
' PathMusic.innerHTML = strMusic
' window.setTimeout "Step3_ShowSize """ & strMusic & """, ""SizeMusic""", 1000, "VBScript"
End If
If IsNull( strPictures ) Then
document.getElementById( "CheckboxIncludePictures" ).checked = False
Else
' PathPictures.innerHTML = strPictures
' window.setTimeout "Step3_ShowSize """ & strPictures & """, ""SizePictures""", 1000, "VBScript"
End If
If IsNull( strVideos ) Then
document.getElementById( "CheckboxIncludeVideos" ).checked = False
Else
' PathVideos.innerHTML = strVideos
' window.setTimeout "Step3_ShowSize """ & strVideos & """, ""SizeVideos""", 1000, "VBScript"
End If
If gvbEditExistingJob Then
Step3_ExistingBackupJobSelection
End If
blnMediaSelectedCloud = RadioButtonBackupMediaCloud.checked And ( SpaceCloudStorage.innerHTML > "0" )
blnMediaSelectedHDD = RadioButtonBackupMediaHDD.checked And ( SpaceHDDStorage.innerHTML > "0" )
blnMediaSelectedNetwork = RadioButtonBackupMediaNetwork.checked And ( SpaceNetworkStorage.innerHTML > "0" )
blnMediaSelectedUSB = RadioButtonBackupMediaUSB.checked And ( SpaceUSBStorage.innerHTML > "0" )
blnMediaSelected = blnMediaSelectedCloud Or blnMediaSelectedHDD Or blnMediaSelectedNetwork Or blnMediaSelectedUSB
If Not blnMediaSelected Then
window.setTimeout "ListBackupMedia", 100, "VBScript"
End If
ButtonBack.disabled = False
ButtonNext.disabled = False
'gviInterval = window.setInterval( "TotalSize", 5000, "VBScript" )
End Sub
Sub Step3_AddCustomFolder( num, myPath )
Dim objButtonAdd, objButtonRemove, objCheckbox, objFSO, objName, objNextRow, objPath, objSize, objSizeGB
Dim strFolder, strName
Set objButtonAdd = document.getElementById( "ButtonIncludeCustom" & num )
Set objButtonRemove = document.getElementById( "ButtonExcludeCustom" & num )
Set objCheckbox = document.getElementById( "CheckboxIncludeCustom" & num )
Set objName = document.getElementById( "NameCustom" & num )
' Set objPath = document.getElementById( "PathCustom" & num )
' Set objSize = document.getElementById( "SizeCustom" & num )
' Set objSizeGB = document.getElementById( "SizeCustom" & num & "GB" )
If IsNull( myPath ) Then
strFolder = SelectFolder( BROWSEFOLDER_DRIVES, "Select a folder to include in the backup" )
Else
strFolder = myPath
End If
If IsNull( strFolder ) Then
gvaCustomPath( num ) = ""
objCheckbox.checked = False
objCheckbox.disabled = True
' objPath.innerHTML = ""
objButtonAdd.style.display = "inline"
objButtonRemove.style.display = "none"
Else
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
gvaCustomPath( num ) = strFolder
strName = objFSO.GetFileName( strFolder )
Set objFSO = Nothing
objCheckbox.checked = True
objCheckbox.disabled = False
If CheckboxShowFullPath.checked Then
objName.innerHTML = strFolder
Else
objName.innerHTML = strName
End If
' objPath.innerHTML = strFolder
objButtonAdd.style.display = "none"
objButtonRemove.style.display = "inline"
If num < 4 Then
Set objNextRow = document.getElementById( "CustomRow" & ( 1 + num ) )
objNextRow.style.display = "table-row"
objNextRow.style.visibility = "visible"
End If
' objSizeGB.innerHTML = "calculating..."
' window.setTimeout "Step3_ShowSize """ & strFolder & """, ""SizeCustom" & num & """", 500, "VBScript"
End If
HelpText.innerHTML = ""
End Sub
Sub Step3_ExistingBackupJobSelection( )
Dim arrJobSourceDirs
Dim blnError, blnMyDocuments, blnMyMusic, blnMyPictures, blnMyVideos
Dim i, intCustom
Dim strCustom1, strCustom2, strCustom3, strCustom4, strJobDescription, strRegKey
Dim wshShell
blnMyDocuments = False
blnMyMusic = False
blnMyPictures = False
blnMyVideos = False
strRegKey = "HKEY_CURRENT_USER\Software\robvanderwoude.com\Backup\BackupJobs\" & gvsExistingBackupJobID
Set wshShell = CreateObject( "WScript.Shell" )
On Error Resume Next
' auto;logoff;logon;manual;schedule
gvaExistingJobBackupTypes = Split( wshShell.RegRead( strRegKey & "\BackupTypes" ), ";" )
' HOUR;minute or DAY;hour;minute or WEEK;dayofweek;hour;minute or MONTH;dayofmonth;hour;minute
gvaExistingJobScheduleInt = Split( wshShell.RegRead( strRegKey & "\ScheduleInterval" ), ";" )
' Number of days when a backup is considered overdue
gvaExistingJobReminderInt = wshShell.RegRead( strRegKey & "\ReminderDays" )
' MYDOCUMENTS;MYMUSIC;MYPICTURES;MYVIDEOS;custom1;custom2;custom3;custom4
arrJobSourceDirs = Split( wshShell.RegRead( strRegKey & "\SourceDirs" ), ";" )
' Backup job name
strJobDescription = wshShell.RegRead( strRegKey & "\Description" )
' Path without drive letter for removable, full path for others
gvsExistingJobTargetDir = wshShell.RegRead( strRegKey & "\TargetDir" )
' cloud;local;network;removable
gvsExistingJobTargetType = wshShell.RegRead( strRegKey & "\TargetType" )
' 8 digits hexadecimal volume serial
gvsExistingJobTargetVol = wshShell.RegRead( strRegKey & "\TargetVolumeSerial" )
' Number of days to keep backups
gviExistingJobRetentionDays = wshShell.RegRead( strRegKey & "\RetentionDays" )
' Number of backups to keep
gviExistingJobRotationNumber = wshShell.RegRead( strRegKey & "\RotationNumber" )
On Error Goto 0
Set wshShell = Nothing
' Select sourcedirs specified by existing job
intCustom = 0
For i = 0 To UBound( arrJobSourceDirs )
Select Case arrJobSourceDirs(i)
Case "MYDOCUMENTS":
blnMyDocuments = True
Case "MYMUSIC":
blnMyMusic = True
Case "MYPICTURES":
blnMyPictures = True
Case "MYVIDEOS":
blnMyVideos = True
Case Else
intCustom = intCustom + 1
Select Case intCustom
Case 1:
strCustom1 = arrJobSourceDirs(i)
Step3_AddCustomFolder 1, strCustom1
Case 2:
strCustom2 = arrJobSourceDirs(i)
Step3_AddCustomFolder 2, strCustom2
Case 3:
strCustom3 = arrJobSourceDirs(i)
Step3_AddCustomFolder 3, strCustom3
Case 4:
strCustom4 = arrJobSourceDirs(i)
Step3_AddCustomFolder 4, strCustom4
Case Else:
blnError = True
End Select
End Select
Next
CheckboxIncludeDocuments.checked = blnMyDocuments
CheckboxIncludeMusic.checked = blnMyMusic
CheckboxIncludePictures.checked = blnMyPictures
CheckboxIncludeVideos.checked = blnMyVideos
End Sub
Sub Step3_RemoveCustomFolder( num )
Dim objButtonAdd, objButtonRemove, objCheckbox, objName, objPath, objSize, objSizeGB
Dim strFolder
gvaCustomPath( num ) = ""
Set objButtonAdd = document.getElementById( "ButtonIncludeCustom" & num )
Set objButtonRemove = document.getElementById( "ButtonExcludeCustom" & num )
Set objCheckbox = document.getElementById( "CheckboxIncludeCustom" & num )
Set objName = document.getElementById( "NameCustom" & num )
' Set objPath = document.getElementById( "PathCustom" & num )
' Set objSize = document.getElementById( "SizeCustom" & num )
' Set objSizeGB = document.getElementById( "SizeCustom" & num & "GB" )
objCheckbox.checked = False
objCheckbox.disabled = True
objName.innerHTML = ""
' objPath.innerHTML = ""
objButtonAdd.style.display = "inline"
objButtonRemove.style.display = "none"
' objSize.innerHTML = "0"
' objSizeGB.innerHTML = ""
TotalSize
End Sub
Sub Step3_ShowFullPath( )
Dim objFSO
If CheckboxShowFullPath.checked Then
LabelIncludeDocuments.innerHTML = gvaSpecialFolders.Item( "MyDocuments" )
LabelIncludeMusic.innerHTML = gvaSpecialFolders.Item( "MyMusic" )
LabelIncludePictures.innerHTML = gvaSpecialFolders.Item( "MyPictures" )
LabelIncludeVideos.innerHTML = gvaSpecialFolders.Item( "MyVideos" )
NameCustom1.innerHTML = gvaCustomPath(1)
NameCustom2.innerHTML = gvaCustomPath(2)
NameCustom3.innerHTML = gvaCustomPath(3)
NameCustom4.innerHTML = gvaCustomPath(4)
' PathDocuments
' SizeDocumentsGB
' SizeDocuments
' PathMusic
' SizeMusicGB
' SizeMusic
' PathPictures
' SizePicturesGB
' SizePictures
' PathVideos
' SizeVideosGB
' SizeVideos
' NameCustom1
' PathCustom1
' SizeCustom1GB
' SizeCustom1
' NameCustom2
' PathCustom2
' SizeCustom2GB
' SizeCustom2
' NameCustom3
' PathCustom3
' SizeCustom3GB
' SizeCustom3
' NameCustom4
' PathCustom4
' SizeCustom4GB
' SizeCustom4
Else
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
LabelIncludeDocuments.innerHTML = "My Documents"
LabelIncludeMusic.innerHTML = "My Music"
LabelIncludePictures.innerHTML = "My Pictures"
LabelIncludeVideos.innerHTML = "My Videos"
NameCustom1.innerHTML = objFSO.GetFileName( gvaCustomPath(1) )
NameCustom2.innerHTML = objFSO.GetFileName( gvaCustomPath(2) )
NameCustom3.innerHTML = objFSO.GetFileName( gvaCustomPath(3) )
NameCustom4.innerHTML = objFSO.GetFileName( gvaCustomPath(4) )
Set objFSO = Nothing
End If
End Sub
Sub Step3_ShowSize( myFolder, myElement )
Dim intSize
intSize = RequiredSpace( myFolder )
document.getElementById( myElement ).innerHTML = intSize
document.getElementById( myElement & "GB" ).innerHTML = GB( intSize, 0 )
TotalSize
End Sub
' Where To Backup
Sub Step4( )
Dim objOption, objDropdown, strBackupDisk, strKey
TableStep1.style.display = "none"
TableStep2.style.display = "none"
TableStep3.style.display = "none"
TableStep4.style.display = "block"
TableStep5.style.display = "none"
TableStep6.style.display = "none"
HelpText.innerHTML = gvaHelpText.Item( "Step4" )
On Error Resume Next
If gvbAdvancedInstall Then
RowBackupMediaNetwork.style.display = "table-row"
RowBackupMediaNetwork.style.display = "block"
Else
RowBackupMediaNetwork.style.display = "none"
End If
ButtonBack.disabled = False
ButtonNext.disabled = True
' Select targetdir specified by existing job
If gvbEditExistingJob Then
Select Case LCase( gvsExistingJobTargetType )
Case "cloud":
RadioButtonBackupMediaCloud.checked = True
Set objDropdown = document.getElementById( "DropdownCloudMedia" )
Case "local":
RadioButtonBackupMediaHDD.checked = True
Case "network":
RadioButtonBackupMediaNetwork.checked = True
Case "removable":
RadioButtonBackupMediaUSB.checked = True
Set objDropdown = document.getElementById( "DropdownUSBMedia" )
Case Else
' Error
End Select
If RadioButtonBackupMediaCloud.checked Or RadioButtonBackupMediaUSB.checked Then
For Each strKey In gvaVolumeSerials.Keys
If UCase( gvaVolumeSerials.Item( strKey ) ) = UCase( gvsExistingJobTargetVol ) Then
strBackupDisk = strKey
End If
Next
objDropdown.style.display = "inline"
For Each objOption In objDropdown.options
If objOption.text = strBackupDisk Then
objOption.selected = True
End If
Next
End If
ButtonNext.disabled = False
End If
On Error Goto 0
End Sub
Sub Step4_ChooseSubfolder( )
Dim objFSO, objOption
Dim strFolder, strMedium, strRoot
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
For Each objOption In ListOfBackupMedia.options
If objOption.selected Then
strMedium = objOption.text
strRoot = objOption.value
End If
Next
strFolder = SelectFolder( strRoot, "Select a location to store the backup scripts" )
PathBackup.innerHTML = strFolder
For Each objOption In ListOfBackupMedia.options
If objOption.selected Then
objOption.value = strFolder
End If
Next
Set objFSO = Nothing
End Sub
Sub Step4_ClearCloudStorage( )
Dim blnFirst, objOption
blnFirst = True
For Each objOption In DropdownCloudMedia.options
objOption.selected = blnFirst
blnFirst = False
Next
PathCloudStorage.innerHTML = ""
SpaceCloudStorage.innerHTML = 0
End Sub
Sub Step4_ClearHDDStorage( )
PathHDDStorage.innerHTML = ""
SpaceHDDStorage.innerHTML = 0
End Sub
Sub Step4_ClearNetworkStorage( )
PathNetworkStorage.innerHTML = ""
SpaceNetworkStorage.innerHTML = 0
End Sub
Sub Step4_ClearUSBStorage( )
Dim blnFirst, objOption
blnFirst = True
For Each objOption In DropdownUSBMedia.options
objOption.selected = blnFirst
blnFirst = False
Next
PathUSBStorage.innerHTML = ""
SpaceUSBStorage.innerHTML = 0
End Sub
Sub Step4_DisplayMediaChoice( )
Dim objOption
gvsTargetPath = ""
If RadioButtonBackupMediaCloud.checked Then
DropdownCloudMedia.style.display = "inline"
DropdownUSBMedia.style.display = "none"
If gvaCloudStorage.Count = 1 Then
HelpText.innerHTML = gvaHelpText.Item( "Step4Subfolder" )
Step4_SetBackupPath
Else
HelpText.innerHTML = gvaHelpText.Item( "Step4Cloud" )
End If
Step4_ClearUSBStorage
Step4_ClearHDDStorage
Step4_ClearNetworkStorage
ElseIf RadioButtonBackupMediaUSB.checked Then
DropdownCloudMedia.style.display = "none"
DropdownUSBMedia.style.display = "inline"
If gvaRemovableStorage.Count = 1 Then
HelpText.innerHTML = gvaHelpText.Item( "Step4Subfolder" )
Step4_SetBackupPath
Else
HelpText.innerHTML = gvaHelpText.Item( "Step4USB" )
End If
Step4_ClearCloudStorage
Step4_ClearHDDStorage
Step4_ClearNetworkStorage
Else
DropdownCloudMedia.style.display = "none"
DropdownUSBMedia.style.display = "none"
If RadioButtonBackupMediaHDD.checked Then
HelpText.innerHTML = gvaHelpText.Item( "Step4HDD" )
Step4_ClearCloudStorage
Step4_ClearUSBStorage
Step4_ClearNetworkStorage
gvsPathHDDStorage = SelectFolder( BROWSEFOLDER_DRIVES, "Select a subfolder for the backup" )
If IsNull( gvsPathHDDStorage ) Then
Step4_DisplayMediaChoice
Exit Sub
End If
gvsTargetPath = gvsPathHDDStorage
gviSpaceHDDStorage = GetAvailableSpace( gvsPathHDDStorage )
PathHDDStorage.innerHTML = gvsPathHDDStorage
' MarkRedIfInsufficient "SpaceCloudStorage"
ElseIf RadioButtonBackupMediaNetwork.checked Then
HelpText.innerHTML = gvaHelpText.Item( "Step4Network" )
Step4_ClearCloudStorage
Step4_ClearUSBStorage
Step4_ClearHDDStorage
gvsPathNetworkStorage = SelectFolder( BROWSEFOLDER_NETWORK, "Select a subfolder for the backup" )
If IsNull( gvsPathNetworkStorage ) Then
Step4_DisplayMediaChoice
Exit Sub
End If
gvsTargetPath = gvsPathNetworkStorage
gviSpaceNetworkStorage = GetAvailableSpace( gvsPathNetworkStorage )
PathNetworkStorage.innerHTML = gvsPathNetworkStorage
' MarkRedIfInsufficient "SpaceHDDStorage"
End If
End If
ButtonNext.disabled = ( gvsTargetPath = "" )
End Sub
Sub Step4_SetBackupPath( )
Dim intSpace
Dim colOptions, objOption
Dim strMedium, strNewPath
If RadioButtonBackupMediaCloud.checked Then
Set colOptions = DropdownCloudMedia.options
Step4_ClearUSBStorage
ElseIf RadioButtonBackupMediaUSB.checked Then
Set colOptions = DropdownUSBMedia.options
Step4_ClearCloudStorage
Else
Exit Sub
End If
For Each objOption In colOptions
If objOption.selected Then
strMedium = objOption.text
gvsTargetPath = objOption.value
End If
Next
If gvsTargetPath = "" Then
ButtonNext.disabled = False
Step4_ClearCloudStorage
Step4_ClearUSBStorage
Exit Sub
End If
strNewPath = SelectFolder( gvsTargetPath, "Select an optional subfolder" )
If Not IsNull( strNewPath ) Then gvsTargetPath = strNewPath
If RadioButtonBackupMediaCloud.checked Then
intSpace = GetAvailableSpace( gvsTargetPath )
PathCloudStorage.innerHTML = gvsTargetPath
SpaceCloudStorage.innerHTML = intSpace
' MarkRedIfInsufficient "SpaceCloudStorage"
ElseIf RadioButtonBackupMediaUSB.checked Then
intSpace = GetAvailableSpace( gvsTargetPath )
PathUSBStorage.innerHTML = gvsTargetPath
SpaceUSBStorage.innerHTML = intSpace
' MarkRedIfInsufficient "SpaceUSBStorage"
End If
ButtonNext.disabled = ( gvsTargetPath = "" )
End Sub
' How And When To Backup
Sub Step5( )
Dim blnScheduleSelected, objOption
TableStep1.style.display = "none"
TableStep2.style.display = "none"
TableStep3.style.display = "none"
TableStep4.style.display = "none"
TableStep5.style.display = "block"
TableStep6.style.display = "none"
On Error Resume Next
If RadioButtonBackupMediaUSB.checked Then
RowOnDiskInsert.style.display = "table-row"
RowOnDiskInsert.style.display = "block"
Else
RowOnDiskInsert.style.display = "none"
End If
On Error Goto 0
HelpText.innerHTML = gvaHelpText.Item( "Step5" )
ButtonBack.disabled = False
ButtonNext.disabled = False
blnScheduleSelected = False
For Each objOption In SelectInterval.options
If objOption.selected Then
If Not objOption.value = "" Then
blnScheduleSelected = True
End If
End If
Next
If Not blnScheduleSelected Then
Step5_FillScheduleLists
End If
End Sub
Sub Step5_FillScheduleListHour( )
Dim i, objOption
SelectHour.innerHTML = ""
For i = 0 To 9
Set objOption = document.createElement( "OPTION" )
objOption.Text = "0" & i
objOption.Value = i
SelectHour.Add( objOption )
Next
For i = 10 To 23
Set objOption = document.createElement( "OPTION" )
objOption.Text = i
objOption.Value = i
SelectHour.Add( objOption )
Next
End Sub
Sub Step5_FillScheduleLists( )
Dim i, objOption
' Interval DropDown
SelectInterval.innerHTML = ""
Set objOption = document.createElement( "OPTION" )
objOption.Text = "-- Interval --"
objOption.Value = ""
SelectInterval.Add( objOption )
Set objOption = document.createElement( "OPTION" )
objOption.Text = "Every hour"
objOption.Value = "hour"
SelectInterval.Add( objOption )
Set objOption = document.createElement( "OPTION" )
objOption.Text = "Daily"
objOption.Value = "day"
SelectInterval.Add( objOption )
Set objOption = document.createElement( "OPTION" )
objOption.Text = "Weekly"
objOption.Value = "week"
SelectInterval.Add( objOption )
Set objOption = document.createElement( "OPTION" )
objOption.Text = "Monthly"
objOption.Value = "month"
SelectInterval.Add( objOption )
' Day Of Month DropDown
SelectDayOfMonth.innerHTML = ""
For i = 1 To 9
Set objOption = document.createElement( "OPTION" )
objOption.Text = " " & i
objOption.Value = i
SelectDayOfMonth.Add( objOption )
Next
For i = 10 To 31
Set objOption = document.createElement( "OPTION" )
objOption.Text = i
objOption.Value = i
SelectDayOfMonth.Add( objOption )
Next
' Day Of Week DropDown
SelectDayOfWeek.innerHTML = ""
Set objOption = document.createElement( "OPTION" )
objOption.Text = "Monday"
objOption.Value = "1"
SelectDayOfWeek.Add( objOption )
Set objOption = document.createElement( "OPTION" )
objOption.Text = "Tuesday"
objOption.Value = "2"
SelectDayOfWeek.Add( objOption )
Set objOption = document.createElement( "OPTION" )
objOption.Text = "Wednesday"
objOption.Value = "3"
SelectDayOfWeek.Add( objOption )
Set objOption = document.createElement( "OPTION" )
objOption.Text = "Thursday"
objOption.Value = "4"
SelectDayOfWeek.Add( objOption )
Set objOption = document.createElement( "OPTION" )
objOption.Text = "Friday"
objOption.Value = "5"
SelectDayOfWeek.Add( objOption )
Set objOption = document.createElement( "OPTION" )
objOption.Text = "Saturday"
objOption.Value = "6"
SelectDayOfWeek.Add( objOption )
Set objOption = document.createElement( "OPTION" )
objOption.Text = "Sunday"
objOption.Value = "7"
SelectDayOfWeek.Add( objOption )
' Hour DropDown
Step5_FillScheduleListHour
' Minute DropDown
SelectMinute.innerHTML = ""
For i = 0 To 5 Step 5
Set objOption = document.createElement( "OPTION" )
objOption.Text = "0" & i
objOption.Value = i
SelectMinute.Add( objOption )
Next
For i = 10 To 55 Step 5
Set objOption = document.createElement( "OPTION" )
objOption.Text = i
objOption.Value = i
SelectMinute.Add( objOption )
Next
' Reminder DropDown
SelectReminderInterval.innerHTML = ""
Set objOption = document.createElement( "OPTION" )
objOption.Text = " 1 day "
objOption.Value = 1
SelectReminderInterval.Add( objOption )
For i = 2 To 9
Set objOption = document.createElement( "OPTION" )
objOption.Text = " " & i & " days"
objOption.Value = i
objOption.selected = ( i = 7 )
SelectReminderInterval.Add( objOption )
Next
For i = 10 To 31
Set objOption = document.createElement( "OPTION" )
objOption.Text = i & " days"
objOption.Value = i
SelectReminderInterval.Add( objOption )
Next
End Sub
Sub Step5_IntervalSelected( )
Dim objOption, strResult
For Each objOption In SelectInterval.options
If objOption.selected Then
strResult = objOption.value
End If
Next
Select Case strResult
Case "hour"
Set objOption = document.createElement( "OPTION" )
HourSpan.style.display = "inline"
SelectHour.innerHTML = ""
objOption.Text = "**"
objOption.Value = ""
SelectHour.Add( objOption )
SelectMinute.style.display = "inline"
SelectDayOfWeek.style.display = "none"
DaySpan.style.display = "none"
CheckboxRunImmediatelyIfMissed.checked = True
Case "day"
Step5_FillScheduleListHour
HourSpan.style.display = "inline"
SelectMinute.style.display = "inline"
SelectDayOfWeek.style.display = "none"
DaySpan.style.display = "none"
CheckboxRunImmediatelyIfMissed.checked = True
Case "week"
Step5_FillScheduleListHour
HourSpan.style.display = "inline"
SelectMinute.style.display = "inline"
DaySpan.style.display = "none"
SelectDayOfWeek.style.display = "inline"
CheckboxRunImmediatelyIfMissed.checked = True
Case "month"
Step5_FillScheduleListHour
HourSpan.style.display = "inline"
SelectMinute.style.display = "inline"
DaySpan.style.display = "inline"
SelectDayOfWeek.style.display = "none"
CheckboxRunImmediatelyIfMissed.checked = True
Case Else
Step5_FillScheduleListHour
HourSpan.style.display = "none"
SelectMinute.style.display = "none"
SelectDayOfWeek.style.display = "none"
DaySpan.style.display = "none"
CheckboxRunImmediatelyIfMissed.checked = False
End Select
End Sub
Sub Step5_ResetScheduleLists( )
Dim blnFirst, objOption
blnFirst = True
For Each objOption In SelectInterval.options
objOption.selected = blnFirst
blnFirst = False
Next
blnFirst = True
For Each objOption In SelectDayOfMonth.options
objOption.selected = blnFirst
blnFirst = False
Next
blnFirst = True
For Each objOption In SelectDayOfWeek.options
objOption.selected = blnFirst
blnFirst = False
Next
blnFirst = True
For Each objOption In SelectHour.options
objOption.selected = blnFirst
blnFirst = False
Next
blnFirst = True
For Each objOption In SelectMinute.options
objOption.selected = blnFirst
blnFirst = False
Next
End Sub
Sub Step5_ScheduleSelected( )
If CheckboxSchedule.checked Then
SelectInterval.style.display = "inline"
IntervalBlock.style.display = "block"
Else
Step5_ResetScheduleLists
SelectInterval.style.display = "none"
IntervalBlock.style.display = "none"
End If
End Sub
' What If ...
Sub Step6( )
Dim blnScheduleSelected, objOption
TableStep1.style.display = "none"
TableStep2.style.display = "none"
TableStep3.style.display = "none"
TableStep4.style.display = "none"
TableStep5.style.display = "none"
TableStep6.style.display = "block"
HelpText.innerHTML = gvaHelpText.Item( "Step6" )
ButtonBack.disabled = False
ButtonNext.disabled = False
blnScheduleSelected = False
For Each objOption In SelectInterval.options
If objOption.selected Then
If Not objOption.value = "" Then
blnScheduleSelected = True
End If
End If
Next
If CheckboxSchedule.checked And blnScheduleSelected Then
CheckboxReminder.checked = False
CheckboxRunImmediatelyIfMissed.checked = True
Else
CheckboxReminder.checked = True
CheckboxRunImmediatelyIfMissed.checked = False
End If
End Sub
Sub Step6_DisplayReminderInterval( )
If CheckboxReminder.checked Then
SelectReminderInterval.style.display = "inline"
Else
SelectReminderInterval.style.display = "none"
End If
End Sub
Sub StepBack( )
If TableStep6.style.display = "block" Then
Step5
ElseIf TableStep5.style.display = "block" Then
Step4
ElseIf TableStep4.style.display = "block" Then
Step3
ElseIf TableStep3.style.display = "block" Then
Step2
ElseIf TableStep2.style.display = "block" Then
Step1
End If
End Sub
Sub StepNext( )
If TableStep1.style.display = "block" Then
Step2
ElseIf TableStep2.style.display = "block" Then
Step3
ElseIf TableStep3.style.display = "block" Then
Step4
ElseIf TableStep4.style.display = "block" Then
Step5
ElseIf TableStep5.style.display = "block" Then
Step6
End If
End Sub
Function TextFromHTML( myURL )
Dim objHTTP
TextFromHTML = ""
On Error Resume Next
Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" )
objHTTP.Open "GET", myURL
objHTTP.Send
If Err Then gvbConnected = False
' Check if the result was valid, and if so return the result
If objHTTP.Status = 200 Then TextFromHTML = objHTTP.ResponseText
Set objHTTP = Nothing
On Error Goto 0
End Function
Sub TotalSize( )
If TableStep3.style.display = "block" Then
gviTotalSize = 0
On Error Resume Next
If CheckboxIncludeDocuments.checked Then gviTotalSize = gviTotalSize + SizeDocuments.innerHTML
If CheckboxIncludeMusic.checked Then gviTotalSize = gviTotalSize + SizeMusic.innerHTML
If CheckboxIncludePictures.checked Then gviTotalSize = gviTotalSize + SizePictures.innerHTML
If CheckboxIncludeVideos.checked Then gviTotalSize = gviTotalSize + SizeVideos.innerHTML
If CheckboxIncludeCustom1.checked Then gviTotalSize = gviTotalSize + SizeCustom1.innerHTML
If CheckboxIncludeCustom2.checked Then gviTotalSize = gviTotalSize + SizeCustom2.innerHTML
If CheckboxIncludeCustom3.checked Then gviTotalSize = gviTotalSize + SizeCustom3.innerHTML
If CheckboxIncludeCustom4.checked Then gviTotalSize = gviTotalSize + SizeCustom4.innerHTML
On Error Goto 0
' SizeTotal.innerHTML = gviTotalSize
' SizeTotalGB.innerHTML = GB( gviTotalSize, 0 )
' MarkRedIfInsufficient "SizeTotal"
ButtonNext.disabled = ( gviTotalSize = 0 )
End If
End Sub
Sub Window_OnLoad
document.title = CrBkupScr.ApplicationName & ", Version " & CrBkupScr.Version & ", © 2015 Rob van der Woude"
gviWidth = 800
gviHeight = 600
WindowSize
ListSpecialFolders
gvsTargetPath = ""
gvbIsElevated = IsElevated( )
gvbEditExistingJob = False
GenerateHelpText
Step1
window.setTimeout "CheckUpdate", 1000, "VBScript"
End Sub
Sub Window_OnUnload
On Error Resume Next
window.clearInterval gviInterval
Set gvaBackupJobs = Nothing
Set gvaCloudStorage = Nothing
Set gvaHelpText = Nothing
Set gvaRemovableStorage = Nothing
Set gvaSpecialFolders = Nothing
Set gvaVolumeSerials = Nothing
On Error Goto 0
End Sub
Sub WindowSize( )
Dim posWidth, posHeight
On Error Resume Next
If gviWidth > window.screen.width Then gviWidth = window.screen.width
If gviHeight > window.screen.height Then gviHeight = window.screen.height
posWidth = ( window.screen.width - gviWidth ) / 2
posHeight = ( window.screen.height - gviHeight ) / 2
If posWidth < 0 Then posWidth = 0
If posHeight < 0 Then posHeight = 0
window.resizeTo gviWidth, gviHeight
window.moveTo posWidth, posHeight
NavigateButtons.style.left = CStr( ( gviWidth / 2 ) - 150 ) & "px"
On Error GoTo 0
End Sub
Function WriteMonitorScript( mySerial )
Dim strScript
strScript = "Option Explicit" & vbCrLf
strScript = strScript & "Dim colEvents, objEvent, objWMIService" & vbCrLf
strScript = strScript & "Set objWMIService = GetObject( ""winmgmts://./root/CIMV2"" )" & vbCrLf
strScript = strScript & "Set colEvents = objWMIService.ExecNotificationQuery( ""SELECT * FROM __InstanceOperationEvent WITHIN 10 WHERE TargetInstance ISA 'Win32_LogicalDisk'"" )" & vbCrLf
strScript = strScript & "Do While True" & vbCrLf
strScript = strScript & vbTab & "Set objEvent = colEvents.NextEvent" & vbCrLf
strScript = strScript & vbTab & "If objEvent.TargetInstance.VolumeSerialNumber = mySerial Then" & vbCrLf
strScript = strScript & vbTab & vbTab & "Select Case objEvent.Path_.Class" & vbCrLf
strScript = strScript & vbTab & vbTab & vbTab & "Case ""__InstanceCreationEvent""" & vbCrLf
strScript = strScript & vbTab & vbTab & vbTab & vbTab & "Wscript.Echo ""Drive "" & objEvent.TargetInstance.DeviceId & "" has been added.""" & vbCrLf
strScript = strScript & vbTab & vbTab & vbTab & "Case ""__InstanceDeletionEvent""" & vbCrLf
strScript = strScript & vbTab & vbTab & vbTab & vbTab & "Wscript.Echo ""Drive "" & objEvent.TargetInstance.DeviceId & "" has been removed.""" & vbCrLf
strScript = strScript & vbTab & vbTab & "End Select" & vbCrLf
strScript = strScript & vbTab & "End If" & vbCrLf
strScript = strScript & "Loop" & vbCrLf
strScript = strScript & "Set colEvents = Nothing" & vbCrLf
strScript = strScript & "Set objWMIService = Nothing" & vbCrLf
GetMonitorScript = strScript
End Function
</script>
<body>
<div class="Center" style="width: 100%;">
<table id="TableStep1">
<tr class="ReallyLarge">
<td> </td>
<th class="Column150">Step 1:</th>
<td> </td>
<th class="Column450">Keep it simple?</th>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td><input type="radio" name="RadioBasicOrAdvanced" id="RadioBasic" onclick="Step1_DisplayBasicOrAdvanced" /></td>
<th><label for="RadioBasic" id="LabelBasic">Basic installation</label></th>
<td> </td>
<th> </th>
</tr>
<tr>
<td><input type="radio" name="RadioBasicOrAdvanced" id="RadioAdvanced" onclick="Step1_DisplayBasicOrAdvanced" /></td>
<th><label for="RadioAdvanced" id="LabelAdvanced">Advanced installation</label></th>
<td> </td>
<th> </th>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td> </td>
<td colspan="3"> </td>
</tr>
</table>
<table id="TableStep2">
<tr class="ReallyLarge">
<td> </td>
<th class="Column150">Step 2:</th>
<td> </td>
<th class="Column450">Backup Job</th>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td><input type="radio" name="RadioBackupJob" id="RadioNewBackupJob" onclick="Step2_DisplayBackupJobs" /></td>
<th><label for="RadioNewBackupJob" id="LabelNewBackupJob">New backup job</label></th>
<td> </td>
<th><input type="text" id="NameOfNewBackupJob" value="New Backup Job" onkeyup="Step2_CheckNameOfNewJob" /> <span id="NewBackupJobID"></span></th>
</tr>
<tr id="RowExistingJobs">
<td><input type="radio" name="RadioBackupJob" id="RadioExistingBackupJob" onclick="Step2_DisplayBackupJobs" disabled="disabled" /></td>
<th colspan="3"><label for="RadioExistingBackupJob" id="LabelExistingBackupJob">Existing backup job</label> <select id="ListOfExistingJobs" onchange="Step2_CheckNameOfNewJob"></select> <span id="ExistingBackupJobID"></span></th>
</tr>
</table>
<table id="TableStep3">
<tr class="ReallyLarge">
<td> </td>
<th class="Column150">Step 3:</th>
<td> </td>
<th class="Column450">What To Backup</th>
<td class="Hidden"></td>
</tr>
<tr>
<td colspan="4"> </td>
<dh class="Hidden"></td>
</tr>
<tr>
<td><input type="Checkbox" id="CheckboxIncludeDocuments" checked="checked" onchange="TotalSize" onclick="TotalSize" /></td>
<td colspan="3"><label for="CheckboxIncludeDocuments" id="LabelIncludeDocuments">My Documents</label></td>
<td id="SizeDocuments" class="Hidden"></td>
</tr>
<tr>
<td><input type="Checkbox" id="CheckboxIncludeMusic" checked="checked" onchange="TotalSize" onclick="TotalSize" /></td>
<td colspan="3"><label for="CheckboxIncludeMusic" id="LabelIncludeMusic">My Music</label></td>
<td id="SizeMusic" class="Hidden"></td>
</tr>
<tr>
<td><input type="Checkbox" id="CheckboxIncludePictures" checked="checked" onchange="TotalSize" onclick="TotalSize" /></td>
<td colspan="3"><label for="CheckboxIncludePictures" id="LabelIncludePictures">My Pictures</label></td>
<td id="SizePictures" class="Hidden"></td>
</tr>
<tr>
<td><input type="Checkbox" id="CheckboxIncludeVideos" checked="checked" onchange="TotalSize" onclick="TotalSize" /></td>
<td colspan="3"><label for="CheckboxIncludeVideos" id="LabelIncludeVideos">My Videos</label></td>
<td id="SizeVideos" class="Hidden"></td>
</tr>
<tr id="CustomRow1">
<td><input type="Checkbox" id="CheckboxIncludeCustom1" disabled="disabled" onchange="TotalSize" onclick="TotalSize" onkeyup="TotalSize" /></td>
<td colspan="3"><label for="CheckboxIncludeCustom1" id="NameCustom1" class="FloatLeft"></label><input type="button" id="ButtonIncludeCustom1" value="Add ..." onclick="Step3_AddCustomFolder 1,Null" /><input type="button" class="FloatRight" id="ButtonExcludeCustom1" value="Remove" style="display: none;" onclick="Step3_RemoveCustomFolder(1)" /></td>
<td id="SizeCustom1" class="Hidden"></td>
</tr>
<tr id="CustomRow2" style="display: none; visibility: collapse;">
<td><input type="Checkbox" id="CheckboxIncludeCustom2" disabled="disabled" onchange="TotalSize" onclick="TotalSize" onkeyup="TotalSize" /></td>
<td colspan="3"><label for="CheckboxIncludeCustom2" id="NameCustom2" class="FloatLeft"></label><input type="button" id="ButtonIncludeCustom2" value="Add ..." onclick="Step3_AddCustomFolder 2,Null" /><input type="button" class="FloatRight" id="ButtonExcludeCustom2" value="Remove" style="display: none;" onclick="Step3_RemoveCustomFolder(2)" /></td>
<td id="SizeCustom2" class="Hidden"></td>
</tr>
<tr id="CustomRow3" style="display: none; visibility: collapse;">
<td><input type="Checkbox" id="CheckboxIncludeCustom3" disabled="disabled" onchange="TotalSize" onclick="TotalSize" onkeyup="TotalSize" /></td>
<td colspan="3"><label for="CheckboxIncludeCustom3" id="NameCustom3" class="FloatLeft"></label><input type="button" id="ButtonIncludeCustom3" value="Add ..." onclick="Step3_AddCustomFolder 3,Null" /><input type="button" class="FloatRight" id="ButtonExcludeCustom3" value="Remove" style="display: none;" onclick="Step3_RemoveCustomFolder(3)" /></td>
<td id="SizeCustom3" class="Hidden"></td>
</tr>
<tr id="CustomRow4" style="display: none; visibility: collapse;">
<td><input type="Checkbox" id="CheckboxIncludeCustom4" disabled="disabled" onchange="TotalSize" onclick="TotalSize" onkeyup="TotalSize" /></td>
<td colspan="3"><label for="CheckboxIncludeCustom4" id="NameCustom4" class="FloatLeft"></label><input type="button" id="ButtonIncludeCustom4" value="Add ..." onclick="Step3_AddCustomFolder 4,Null" /><input type="button" class="FloatRight" id="ButtonExcludeCustom4" value="Remove" style="display: none;" onclick="Step3_RemoveCustomFolder(4)" /></td>
<td id="SizeCustom4" class="Hidden"></td>
</tr>
<tr>
<td colspan="4"> </td>
<dh class="Hidden"></td>
</tr>
<tr id="RowStep3_ShowFullPath" style="display: none;">
<td><input type="Checkbox" id="CheckboxShowFullPath" onclick="Step3_ShowFullPath" /></td>
<td colspan="3"><label for="CheckboxShowFullPath" id="LabelShowFullPath">Show full paths instead of names</label></td>
<td class="Hidden"></td>
</tr>
</table>
<table id="TableStep4">
<tr class="ReallyLarge">
<td> </td>
<th class="Column150">Step 4:</th>
<td> </td>
<th class="Column450" colspan="3">Where To Backup <input type="button" class="FloatRight" id="ButtonSearchMedia" value="Rescan" onclick="ListBackupMedia" onkeyup="ListBackupMedia" title="Click to refresh the list of available backup devices" /></th>
<td class="Hidden"></td>
</tr>
<tr>
<td colspan="6"> </td>
<dh class="Hidden"></td>
</tr>
<tr id="RowBackupMediaCloud">
<td><input type="radio" name="RadioButtonBackupMedia" id="RadioButtonBackupMediaCloud" value="cloud" onclick="Step4_DisplayMediaChoice" /></td>
<td><label for="RadioButtonBackupMediaCloud" id="LabelBackupMediaCloud">Cloud storage</label></td>
<td> </td>
<td class="Colum200"><select id="DropdownCloudMedia" onchange="Step4_SetBackupPath"></select></td>
<td> </td>
<td class="Colum200" id="PathCloudStorage"> </td>
<td id="SpaceCloudStorage" class="Hidden"></td>
</tr>
<tr id="RowBackupMediaUSB">
<td><input type="radio" name="RadioButtonBackupMedia" id="RadioButtonBackupMediaUSB" value="usb" onclick="Step4_DisplayMediaChoice" /></td>
<td><input type="button" id="ButtonChooseSubfolder" value="Subfolder..." onclick="Step4_ChooseSubfolder" /></div><label for="RadioButtonBackupMediaUSB" id="LabelBackupMediaUSB">USB drive</label></td>
<td> </td>
<td class="Colum200"><select id="DropdownUSBMedia" onchange="Step4_SetBackupPath"></select></td>
<td> </td>
<td class="Colum200" id="PathUSBStorage"> </td>
<td id="SpaceUSBStorage" class="Hidden"></td>
</tr>
<tr id="RowBackupMediaHDD">
<td><input type="radio" name="RadioButtonBackupMedia" id="RadioButtonBackupMediaHDD" value="hdd" onclick="Step4_DisplayMediaChoice" /></td>
<td><label for="RadioButtonBackupMediaHDD" id="LabelBackupMediaHDD">Local harddisk</label></td>
<td> </td>
<td id="PathHDDStorage" colspan="3"> </td>
<td id="SpaceHDDStorage" class="Hidden"></td>
</tr>
<tr id="RowBackupMediaNetwork">
<td><input type="radio" name="RadioButtonBackupMedia" id="RadioButtonBackupMediaNetwork" value="network" onclick="Step4_DisplayMediaChoice" /></td>
<td><label for="RadioButtonBackupMediaNetwork" id="LabelBackupMediaNetwork">Network drive</label></td>
<td> </td>
<td id="PathNetworkStorage" colspan="3"> </td>
<td id="SpaceNetworkStorage" class="Hidden"></td>
</tr>
</table>
<table id="TableStep5">
<tr class="ReallyLarge">
<td> </td>
<th class="Column150">Step 5:</th>
<td> </td>
<th class="Column450">How And When To Backup</th>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td><input type="Checkbox" id="CheckboxManual" checked="checked" /></td>
<td><label for="CheckboxManual" id="LabelManual1">Manually (create a shortcut)</label></td>
<td> </td>
<td><label for="CheckboxManual" id="LabelManual2">When I doubleclick the shortcut</label></td>
</tr>
<tr>
<td><input type="Checkbox" id="CheckboxAtLogon" /></td>
<td><label for="CheckboxAtLogon" id="LabelAtLogon1">At logon</label></td>
<td> </td>
<td><label for="CheckboxAtLogon" id="LabelAtLogon2">When I log in</label></td>
</tr>
<tr>
<td><input type="Checkbox" id="CheckboxAtLogoff" /></td>
<td><label for="CheckboxAtLogoff" id="LabelAtLogoff1">At logoff</label></td>
<td> </td>
<td><label for="CheckboxAtLogoff" id="LabelAtLogoff2">When I log out</label></td>
</tr>
<tr>
<td><input type="Checkbox" id="CheckboxSchedule" onclick="Step5_ScheduleSelected" onkeyup="Step5_ScheduleSelected" /></td>
<td><label for="CheckboxSchedule" id="LabelSchedule">Scheduled</label></td>
<td> </td>
<td><div id="IntervalBlock"><select id="SelectInterval" style="display: none;" onchange="Step5_IntervalSelected"></select>
<span id="DaySpan" style="display: none;">Day: <select id="SelectDayOfMonth"></select></span>
<select id="SelectDayOfWeek" style="display: none;"></select>
<span id="HourSpan" style="display: none;">Time: <select id="SelectHour"></select>:</span>
<select id="SelectMinute" style="display: none;"></select></div></td>
</tr>
<tr id="RowOnDiskInsert">
<td><input type="Checkbox" id="CheckboxOnDiskInsert" /></td>
<td><label for="CheckboxOnDiskInsert" id="LabelOnDiskInsert1">Automatically</label></td>
<td> </td>
<td><label for="CheckboxOnDiskInsert" id="LabelOnDiskInsert2">When the selected backup medium is inserted</label></td>
</tr>
</table>
<table id="TableStep6">
<tr class="ReallyLarge">
<td> </td>
<th class="Column150">Step 6:</th>
<td> </td>
<th class="Column450">What if I missed a backup?</th>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr id="RowReminderManual">
<td><input type="Checkbox" id="CheckboxReminder" checked="checked" onclick="Step6_DisplayReminderInterval" /></td>
<td colspan="3"><select id="SelectReminderInterval"></select><label for="CheckboxReminder" id="LabelReminder">Remind me after...</label></td>
</tr>
<tr id="RowRunImmediatelyIfMissed">
<td><input type="Checkbox" id="CheckboxRunImmediatelyIfMissed" /></td>
<td colspan="3"><label for="CheckboxRunImmediatelyIfMissed" id="LabelRunImmediatelyIfMissed">Run as soon as possible after missed schedule</label></td>
</tr>
</table>
<div id="Navigate">
<p id="HelpText"></p>
<p id="NavigateButtons"><input type="button" id="ButtonBack" value="<< Back" onclick="StepBack" /> <input type="button" id="ButtonNext" value="Next >>" onclick="StepNext" /></p>
</div>
</div>
</body>
</html>
page last modified: 2024-04-16; loaded in 0.0492 seconds