Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for createbackupscript.hta

(view source code of createbackupscript.hta as plain text)

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Create Backup Script</title>
  5. <HTA:APPLICATION
  6.   APPLICATIONNAME="Create Backup Script"
  7.   ID="CrBkupScr"
  8.   VERSION="0.16 alpha"
  9.   ICON="http://www.robvanderwoude.com/pictures/createbackupscript.ico"/>
  10.  
  11. <style type="text/css">
  1. body {
  2. 	background-color: white;
  3. 	color: darkblue;
  4. 	font-family: arial, sans-serif;
  5. 	font-size: 12pt;
  6. }
  7.  
  8. div#ChooseSubfolderBlock, div#ListCloudMedia, div#ListUSBMedia {
  9. 	display: none;
  10. 	float: right;
  11. 	position: relative;
  12. 	right: 0;
  13. 	top: 0;
  14. }
  15.  
  16. div#Navigate {
  17. 	bottom: 25px;
  18. 	float: bottom;
  19. 	left: 0;
  20. 	position: fixed;
  21. 	width: 100%;
  22. }
  23.  
  24. div#PathBackup {
  25. 	float: left;
  26. 	left: 0;
  27. 	position: relative;
  28. 	top: 5px;
  29. }
  30.  
  31. input[type=button] {
  32. 	color: darkblue;
  33. 	/* font-weight: bold; */
  34. 	height: 24px;
  35. 	margin: 3px 0 3px 0;
  36. 	vertical-align: middle;
  37. 	width: 100px;
  38. }
  39.  
  40. input#ButtonChooseSubfolder {
  41. 	display: none;
  42. 	float: right;
  43. 	position: relative;
  44. 	right: 0;
  45. 	top: 0;
  46. }
  47.  
  48. input#NameOfNewBackupJob {
  49. 	display: none;
  50. }
  51.  
  52. p#HelpText {
  53. 	text-align: left;
  54. 	width: 80%;
  55. }
  56.  
  57. p#NavigateButtons {
  58. 	width: 300px;
  59. }
  60.  
  61. select.Right option {
  62. 	text-align: right;
  63. }
  64.  
  65. select.Wide, option {
  66. 	width: 100%;
  67. }
  68.  
  69. select#ListOfExistingJobs {
  70. 	display: none;
  71. }
  72.  
  73. select#SelectReminderInterval {
  74. 	float: right;
  75. 	position: relative;
  76. 	right: 0;
  77. 	top: 0;
  78. }
  79.  
  80. table#TableStep2, table#TableStep3, table#TableStep4, table#TableStep5, table#TableStep6 {
  81. 	display: none;
  82. }
  83.  
  84. td {
  85. 	height: 32px;
  86. 	text-align: left;
  87. 	vertical-align: middle;
  88. }
  89.  
  90. /*
  91. td, th, tr {
  92. 	border: 1px solid red;
  93. 	white-space: nowrap;
  94. }
  95. */
  96.  
  97. td.Hidden, th.Hidden {
  98. 	display: none;
  99. 	visibility: collapse;
  100. }
  101.  
  102. td.Right {
  103. 	text-align: right;
  104. }
  105.  
  106. th {
  107. 	height: 32px;
  108. 	text-align: left;
  109. 	vertical-align: middle;
  110. }
  111.  
  112. th.Column150 {
  113. 	width: 150px;
  114. }
  115.  
  116. th.Column200 {
  117. 	width: 200px;
  118. }
  119.  
  120. th.Column250 {
  121. 	width: 250px;
  122. }
  123.  
  124. th.Column350 {
  125. 	width: 350px;
  126. }
  127.  
  128. th.Column450 {
  129. 	width: 450px;
  130. }
  131.  
  132. tr {
  133. 	vertical-align: middle;
  134. }
  135.  
  136. tr.Borders th {
  137. 	background-color: darkcyan;
  138. 	border: 2px solid darkblue;
  139. 	color: white;
  140. 	padding: 5px 15px;
  141. }
  142.  
  143. tr.ReallyLarge td, tr.ReallyLarge th {
  144. 	font-size: 150%;
  145. 	padding-bottom: 15px;
  146. }
  147.  
  148. tr#RowOnDiskInsert {
  149. 	display: none;
  150. }
  151.  
  152. .Center {
  153. 	margin-left: auto;
  154. 	margin-right: auto;
  155. 	text-align: center;
  156. }
  157.  
  158. .FloatLeft {
  159. 	float: left;
  160. 	position: relative;
  161. 	right: 0;
  162. 	top: 7px;
  163. }
  164.  
  165. .FloatRight {
  166. 	float: right;
  167. 	position: relative;
  168. 	right: 0;
  169. 	top: 0;
  170. }
  171.  
  172. .Hidden {
  173. 	display: none;
  174. }
  175.  
  176. .Left {
  177. 	text-align: center;
  178. }
  179.  
  180. .Middle {
  181. 	vertical-align: middle;
  182. }
  183.  
  184. .Right {
  185. 	text-align: right;
  186. }
  1. </style>
  2.  
  3. </head>
  4.  
  5. <script language="VBScript">
  1. Option Explicit
  2.  
  3. ' Global arrays, lists and dictionaries
  4. Dim gvaBackupJobs, gvaCloudStorage, gvaCustomPath(4), gvaDriveTypesFSO, gvaDriveTypesWMI, gvaExistingJobBackupTypes, gvaExistingJobReminderInt, gvaExistingJobScheduleInt, gvaHelpText, gvaRemovableStorage, gvaSpecialFolders, gvaVolumeSerials
  5. ' Global booleans
  6. Dim gvbAdvancedInstall, gvbEditExistingJob, gvbIsElevated, gvbStep1Ready, gvbStep2Ready, gvbStep3Ready, gvbStep4Ready, gvbStep5Ready, gvbStep6Ready
  7. ' Global integers
  8. Dim gviExistingJobRetentionDays, gviExistingJobRotationNumber, gviHeight, gviInterval, gviSpaceCloudStorage, gviSpaceHDDStorage, gviSpaceNetworkStorage, gviSpaceUSBStorage, gviTotalSize, gviWidth
  9. ' Global stings
  10. Dim gvsExistingBackupJobID, gvsExistingJobTargetDir, gvsExistingJobTargetType, gvsExistingJobTargetVol, gvsPathCloudStorage, gvsPathHDDStorage, gvsPathNetworkStorage, gvsPathUSBStorage, gvsTargetPath
  11.  
  12. ' I/O Mode constants
  13. Const ForAppending = 8
  14. Const ForReading   = 1
  15. Const ForWriting   = 2
  16. ' WMI Registry constants
  17. Const HKEY_CURRENT_USER   = &H80000001
  18. Const HKEY_LOCAL_MACHINE  = &H80000002
  19. Const REG_SZ              = 1
  20. ' FSO DriveType constants
  21. Const DRIVETYPE_UNKNOWN   = 0
  22. Const DRIVETYPE_REMOVABLE = 1
  23. Const DRIVETYPE_FIXED     = 2
  24. Const DRIVETYPE_NETWORK   = 3
  25. Const DRIVETYPE_CDROM     = 4
  26. Const DRIVETYPE_RAMDISK   = 5
  27. ' BrowseFolder constant to return only file system directories
  28. Const BROWSEFOLDER_RETURNONLYFSDIRS =  1
  29. Const BROWSEFOLDER_EDITBOX          = 16
  30. Const BROWSEFOLDER_NEWDIALOGSTYLE   = 64
  31. ' BrowseFolder start folder constants
  32. Const BROWSEFOLDER_DESKTOP          =  0
  33. Const BROWSEFOLDER_PROGRAMS         =  2
  34. Const BROWSEFOLDER_DRIVES           = 17 ' Ignored in Windows 10?
  35. Const BROWSEFOLDER_NETWORK          = 18
  36. Const BROWSEFOLDER_NETHOOD          = 19
  37. Const BROWSEFOLDER_PROGRAMFILES     = 38
  38. Const BROWSEFOLDER_PROGRAMFILESx86  = 48
  39. Const BROWSEFOLDER_WINDOWS          = 36
  40.  
  41. ' DriveType descriptions
  42. gvaDriveTypesFSO = Split( "Unknown,Removable,Harddisk,Network,CD-ROM,RAM Disk", "," )
  43. gvaDriveTypesWMI = Split( "Unknown,NoRootDirectory,Removable,Harddisk,Network,CD-ROM,RAM Disk", "," )
  44.  
  45.  
  46. Sub CheckUpdate( )
  47. 	Dim intAnswer, intButtons, lenLatestVer, strCurrentVer, strLatestver, strPrompt, strTitle, wshShell
  48. 	' Change cursor to hourglass while checking for update
  49. 	Document.Body.style.Cursor = "wait"
  50. 	intButtons = vbYesNoCancel + vbApplicationModal + vbInformation
  51. 	Set wshShell  = CreateObject( "WScript.Shell" )
  52. 	strCurrentVer = Split( CrBkupScr.Version )(0)
  53. 	strLatestVer  = TextFromHTML( "http://www.robvanderwoude.com/updates/createbackupscript.txt" )
  54. 	If strCurrentVer <> strLatestver Then
  55. 		On Error Resume Next
  56. 		' Clear the IE cache
  57. 		wshShell.Run "RUNDll32.EXE InetCpl.cpl,ClearMyTracksByProcess 8", 7, True
  58. 		' Try again, read the latest version info from the web
  59. 		strLatestver = TextFromHTML( "http://www.robvanderwoude.com/updates/createbackupscript.txt" )
  60. 		On Error Goto 0
  61. 	End If
  62. 	lenLatestVer = Len( strLatestVer )
  63. 	If lenLatestVer = 4 Then
  64. 		If strLatestVer < strCurrentVer Then
  65. 			strTitle  = "Unofficial version"
  66. 			strPrompt = "You seem to be using a pre-release version (" & strCurrentVer & ") of CreateBackupScript.hta." _
  67. 			          & vbCrLf & vbCrLf _
  68. 			          & "The latest official release is " & strLatestver _
  69. 			          & vbCrLf & vbCrLf _
  70. 			          & "Do you want to download the latest official release?"
  71. 			intAnswer = MsgBox( strPrompt, intButtons + vbDefaultButton2, strTitle )
  72. 			If intAnswer = vbYes Then
  73. 				wshShell.Run "http://www.robvanderwoude.com/htaexamples.php#CreateBackupScript", 3, False
  74. 			End If
  75. 		End If
  76. 		If strLatestVer > strCurrentVer Then
  77. 			strTitle  = "Old version"
  78. 			strPrompt = "You are using version " & strCurrentVer & " of CreateBackupScript.hta." _
  79. 			          & vbCrLf & vbCrLf _
  80. 			          & "The latest official release is " & strLatestver _
  81. 			          & vbCrLf & vbCrLf _
  82. 			          & "Do you want to download the latest official release?"
  83. 			intAnswer = MsgBox( strPrompt, intButtons, strTitle )
  84. 			If intAnswer = vbYes Then
  85. 				wshShell.Run "http://www.robvanderwoude.com/htaexamples.php#CreateBackupScript", 3, False
  86. 			End If
  87. 		End If
  88. 	Else
  89. 		strTitle  = "Update Check Failure"
  90. 		strPrompt = "Unable to check for updates." _
  91. 		          & vbCrLf & vbCrLf _
  92. 		          & "Do you want to ""manually"" check for updates now?"
  93. 		intAnswer = MsgBox( strPrompt, intButtons, strTitle )
  94. 		If intAnswer = vbYes Then
  95. 			wshShell.Run "htaexamples.php#CreateBackupScript", 3, False
  96. 		End If
  97. 	End If
  98. 	Set wshShell = Nothing
  99. 	' Change cursor back to default
  100. 	Document.Body.style.Cursor = "default"
  101. End Sub
  102.  
  103.  
  104. Function GB( myBytes, myDigits )
  105. 	Dim objOption
  106. 	If myBytes = "" Then
  107. 		GB = ""
  108. 	ElseIf myDigits = 0 Then
  109. 		' Left aligned unpadded output
  110. 		GB = CLng( myBytes / ( 1024 * 1024 * 1024 ) ) & " GB"
  111. 	Else
  112. 		' Right aligned padded output
  113. 		GB = Right( Space( myDigits ) & CLng( myBytes / ( 1024 * 1024 * 1024 ) ), myDigits ) & " GB"
  114. 	End If
  115. End Function
  116.  
  117.  
  118. Sub GenerateHelpText( )
  119. 	Set gvaHelpText = CreateObject( "Scripting.Dictionary" )
  120. 	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)."
  121. 	gvaHelpText.Item( "Step2Basic" )            = "Edit the name of the new backup job and click ""Next""."
  122. 	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."
  123. 	gvaHelpText.Item( "Step2AdvancedNew" )      = "Edit the name of the new backup job and click ""Next""."
  124. 	gvaHelpText.Item( "Step2AdvancedExisting" ) = "Select the backup job you want to edit from the dropdown list and continue."
  125. 	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."
  126. 	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."
  127. 	gvaHelpText.Item( "Step4" )                 = "Select the type of backup medium you want to save your backups to."
  128. 	gvaHelpText.Item( "Step4Cloud" )            = "Select which cloud storage you want to use."
  129. 	gvaHelpText.Item( "Step4HDD" )              = "Select which local harddisk storage you want to use."
  130. 	gvaHelpText.Item( "Step4Network" )          = "Select which network storage you want to use."
  131. 	gvaHelpText.Item( "Step4USB" )              = "Select which removable device you want to use."
  132. 	gvaHelpText.Item( "Step4Subfolder" )        = "Select an optional subfolder to save the backups to."
  133. 	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."
  134. 	gvaHelpText.Item( "Step6" )                 = "Choose what to do if a backup is missed or overdue."
  135. End Sub
  136.  
  137.  
  138. Function GetAvailableSpace( myPath )
  139. 	Dim objFSO, strDrive
  140. 	GetAvailableSpace = -1
  141. 	On Error Resume Next
  142. 	Set objFSO = CreateObject( "Scripting.FileSystemObject" )
  143. 	strDrive = objFSO.GetDriveName( myPath )
  144. 	GetAvailableSpace = objFSO.GetDrive( strDrive ).AvailableSpace
  145. 	Set objFSO = Nothing
  146. 	On Error Goto 0
  147. End Function
  148.  
  149.  
  150. Sub GetDropbox( )
  151. 	' Check if Dropbox is installed (http://www.dropbox.com)
  152. 	Dim blnDropbox
  153. 	Dim objFile, objFSO, objMatch, objMatches, objRE, objSubMatch, wshShell
  154. 	Dim strConfigFile, strConfigText, strKey, strValue
  155.  
  156. 	blnDropbox    = False
  157. 	strConfigFile = ""
  158. 	Set wshShell = CreateObject( "WScript.Shell" )
  159. 	Set objFSO   = CreateObject( "Scripting.FileSystemObject" )
  160. 	Set objRE    = New RegExp
  161. 	objRE.Global     = True
  162. 	objRE.IgnoreCase = True
  163. 	On Error Resume Next
  164. 	strTest = wshshell.RegRead( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Dropbox\DisplayName" )
  165. 	If Err Then
  166. 		strTest = wshshell.RegRead( "HKEY_LOCAL_MACHINE\Wow6432Node\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Dropbox\DisplayName" )
  167. 		If Not Err Then blnDropbox = True
  168. 	Else
  169. 		blnDropbox = True
  170. 	End If
  171. 	On Error Goto 0
  172. 	If blnDropbox Then
  173. 		If objFSO.FileExists( wshShell.ExpandEnvironmentStrings( "%APPDATA%\Dropbox\info.json" ) ) Then
  174. 			strConfigFile = wshShell.ExpandEnvironmentStrings( "%APPDATA%\Dropbox\info.json" )
  175. 		ElseIf objFSO.FileExists( wshShell.ExpandEnvironmentStrings( "%LOCALAPPDATA%\Dropbox\info.json" ) ) Then
  176. 			strConfigFile = wshShell.ExpandEnvironmentStrings( "%LOCALAPPDATA%\Dropbox\info.json" )
  177. 		End If
  178. 		If strConfigFile <> "" Then
  179. 			Set objFile = objFSO.OpenTextFile( strConfigFile, ForReading )
  180. 			strConfigText = objFile.ReadAll( )
  181. 			objFile.Close
  182. 			Set objFile = Nothing
  183. 			objRE.Pattern = "\""(business|personal)\"":\s*{"
  184. 			If objRE.Test( strConfigText ) Then
  185. 				strKey   = ""
  186. 				strValue = ""
  187. 				Set objMatches = objRE.Execute( strConfigText )
  188. 				For Each objMatch In objMatches
  189. 					For Each objSubMatch In objMatch.Submatches
  190. 						strKey = objSubMatch
  191. 					Next
  192. 				Next
  193. 				If strKey <> "" Then
  194. 					objRE.Pattern = "\""(" & strKey & ")\"":\s*{[^}]*\""path\"":\s*\""([^\""]+)\"""
  195. 					strKey = "Dropbox (" & strKey & ")"
  196. 					If objRE.Test( strConfigText ) Then
  197. 						Set objMatches = objRE.Execute( strConfigText )
  198. 						For Each objMatch In objMatches
  199. 							For Each objSubMatch In objMatch.Submatches
  200. 								strValue = objSubMatch
  201. 								strValue = Replace( strValue, "\.", "." )
  202. 								strValue = Replace( strValue, "\(", "(" )
  203. 								strValue = Replace( strValue, "\)", ")" )
  204. 								strValue = Replace( strValue, "\+", "+" )
  205. 								strValue = Replace( strValue, "\-", "-" )
  206. 								strValue = Replace( strValue, "\\", "\" )
  207. 							Next
  208. 						Next
  209. 					End If
  210. 					gvaCloudStorage.Item( strKey ) = strValue
  211. 				End If
  212. 			End If
  213. 		End If
  214. 	End If
  215. 	On Error Goto 0
  216. 	Set objRE    = Nothing
  217. 	Set objFSO   = Nothing
  218. 	Set wshShell = Nothing
  219. End Sub
  220.  
  221.  
  222. Sub GetGoogleDrive( )
  223. 	' Based on code found at http://stackoverflow.com/a/13703215
  224. 	Dim objConfigFile, objFSO, objMatch, objMatches, objSubMatch, objRE, wshShell
  225. 	Dim strConfigFile, strConfigText, strKey, strValue
  226. 	strKey   = "Google Drive"
  227. 	strValue = ""
  228. 	Set wshShell = CreateObject( "WScript.Shell" )
  229. 	Set objFSO   = CreateObject( "Scripting.FileSystemObject" )
  230. 	strConfigFile = wshShell.ExpandEnvironmentStrings( "%LOCALAPPDATA%\Google\Drive\sync_config.db" )
  231. 	If objFSO.FileExists( strConfigFile ) Then
  232. 		Set objConfigFile = objFSO.OpenTextFile( strConfigFile, ForReading )
  233. 		strConfigText = objConfigFile.ReadAll( )
  234. 		objConfigFile.Close
  235. 		Set objConfigFile = Nothing
  236. 		Set objRE = New RegExp
  237. 		objRE.Global     = True
  238. 		objRE.IgnoreCase = True
  239. 		objRE.Pattern    = "local_sync_root_pathvalue[^a-z]*([a-z]:\\[\w_-\.\\]+)"
  240. 		If objRE.Test( strConfigText ) Then
  241. 			Set objMatches = objRE.Execute( strConfigText )
  242. 			For Each objMatch In objMatches
  243. 				For Each objSubMatch In objMatch.Submatches
  244. 					If objFSO.FolderExists( objSubMatch ) Then
  245. 						strValue = objSubMatch
  246. 					End If
  247. 				Next
  248. 			Next
  249. 			If strValue <> "" Then
  250. 				gvaCloudStorage.Item( strKey ) = strValue
  251. 			End If
  252. 		End If
  253. 		Set objMatches = Nothing
  254. 		Set objRE      = Nothing
  255. 	End If
  256. 	Set objFSO   = Nothing
  257. 	Set wshShell = Nothing
  258. End Sub
  259.  
  260.  
  261. Sub GetSkyDrive( )
  262. 	' Based on code found at http://stackoverflow.com/a/13703215
  263. 	Dim objFSO, strFolder, strKey, strRegVal, wshShell
  264. 	Set wshShell = CreateObject( "WScript.Shell" )
  265. 	On Error Resume Next
  266. 	strRegVal = "HKEY_CURRENT_USER\Software\Microsoft\SkyDrive\UserFolder"
  267. 	strFolder = wshShell.RegRead( strRegVal )
  268. 	If Not Err Then
  269. 		If Trim( " " & strFolder ) <> "" Then
  270. 			Set objFSO = CreateObject( "Scripting.FileSystemObject" )
  271. 			If objFSO.FolderExists( strFolder ) Then
  272. 				strKey = "SkyDrive (OneDrive)"
  273. 				gvaCloudStorage.Item( strKey ) = strValue
  274. 			End If
  275. 			Set objFSO = Nothing
  276. 		End If
  277. 	End If
  278. 	On Error Goto 0
  279. 	Set wshShell = Nothing
  280. End Sub
  281.  
  282.  
  283. Sub GetSync( )
  284. 	' Check if Sync is installed (http://www.sync.com)
  285. 	Dim blnSyncFolderFound, blnSyncInstalled
  286. 	Dim objConfigFile, objFile, objFSO, objMatches, objMatch, objRE, objSubMatch, wshShell
  287. 	Dim strConfigFile, strConfigFolder, strConfigText, strInstallDir, strKey, strRegVal, strValue
  288. 	blnSyncInstalled = False
  289. 	Set wshShell = CreateObject( "WScript.Shell" )
  290. 	Set objFSO = CreateObject( "Scripting.FileSystemObject" )
  291. 	On Error Resume Next
  292. 	strRegVal     = "HKEY_LOCAL_MACHINE\SOFTWARE\Sync.com\Conf\installdir"
  293. 	strInstallDir = wshShell.RegRead( strRegVal )
  294. 	If Err Then
  295. 		strRegVal     = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Sync.com\Conf\installdir"
  296. 		strInstallDir = wshShell.RegRead( strRegVal )
  297. 		If Not Err Then
  298. 			blnSyncInstalled = True
  299. 		End If
  300. 	Else
  301. 		blnSyncInstalled = True
  302. 	End If
  303. 	On Error Goto 0
  304. 	If Trim( " " & strInstallDir ) = "" Then
  305. 		blnSyncInstalled = False
  306. 	Else
  307. 		If Not objFSO.FolderExists( strInstallDir ) Then blnSyncInstalled = False
  308. 	End If
  309. 	If blnSyncInstalled Then
  310. 		blnSyncFolderFound = False
  311. 		strKey             = "Sync.com"
  312. 		strConfigFolder    = wshShell.ExpandEnvironmentStrings( "%LOCALAPPDATA%\Sync.logs\" )
  313. 		With objFSO
  314. 			For Each objFile In .GetFolder( strConfigFolder ).Files
  315. 				If Not blnSyncFolderFound Then
  316. 					If Left( LCase( .GetFileName( objFile.Path ) ), 15 ) = "sync-worker.log" Then
  317. 						strConfigFile = objFile.Path
  318. 						strConfigText = ""
  319. 						Set objConfigFile = .OpenTextFile( strConfigFile, ForReading, False )
  320. 						strConfigText = objConfigFile.ReadAll( )
  321. 						objConfigFile.Close
  322. 						Set objConfigFile = Nothing
  323. 						If Trim( strConfigText ) <> "" Then
  324. 							Set objRE = New RegExp
  325. 							objRE.Global     = True
  326. 							objRE.IgnoreCase = True
  327. 							objRE.Pattern    = "sharedfolder\s*=\s*([^\n\r]+)[\n\r]"
  328. 							If objRE.Test( strConfigText ) Then
  329. 								strValue = ""
  330. 								Set objMatches = objRE.Execute( strConfigText )
  331. 								For Each objMatch In objMatches
  332. 									For Each objSubMatch In objMatch.Submatches
  333. 										strValue = objSubMatch
  334. 									Next
  335. 								Next
  336. 								Set objMatches = Nothing
  337. 								If Not Trim( strValue ) = "" Then
  338. 									strValue = Replace( strValue, "/", "\" )
  339. 									If objFSO.FolderExists( strValue ) Then
  340. 										gvaCloudStorage.Item( strKey ) = strValue
  341. 										blnSyncFolderFound             = True
  342. 									End If
  343. 								End If
  344. 							End If
  345. 							Set objRE = Nothing
  346. 						End If
  347. 					End If
  348. 				End If
  349. 			Next
  350. 		End With
  351. 	End If
  352. 	Set objFSO = Nothing
  353. 	Set wshShell = Nothing
  354. End Sub
  355.  
  356.  
  357. Function IsElevated( )
  358.     ' Based on code by Denis St-Pierre
  359.     Dim intRC, wshShell
  360.     IsElevated = False
  361.     Set wshShell = CreateObject( "WScript.Shell" )
  362.     On Error Resume Next
  363.     intRC = wshShell.Run( "CMD /C OPENFILES > NUL 2>&1", 7, True )
  364.     If Err Then intRC = 1
  365.     On Error Goto 0
  366. 	Set wshShell = Nothing
  367.    	IsElevated = ( intRC = 0 )
  368. End Function
  369.  
  370.  
  371. Sub ListBackupMedia( )
  372. 	'Dim objDrive, objFile, objFSO, objMatch, objMatches, objOption, objRE, objSubMatch, wshShell
  373. 	Dim objOption, strKey
  374.  
  375. 	' Clear all existing choices and status information
  376. 	RadioButtonBackupMediaCloud.checked = False
  377. 	PathCloudStorage.innerHTML          = "&nbsp;"
  378. '	SpaceCloudStorageGB.innerHTML       = "&nbsp;"
  379. 	SpaceCloudStorage.innerHTML         = 0
  380. 	RowBackupMediaCloud.style.display   = "none"
  381. 	DropdownCloudMedia.style.display    = "none"
  382.  
  383. 	RadioButtonBackupMediaUSB.checked = False
  384. 	PathUSBStorage.innerHTML          = "&nbsp;"
  385. '	SpaceUSBStorageGB.innerHTML       = "&nbsp;"
  386. 	SpaceUSBStorage.innerHTML         = 0
  387. 	RowBackupMediaUSB.style.display   = "none"
  388. 	DropdownUSBMedia.style.display    = "none"
  389.  
  390. 	RadioButtonBackupMediaHDD.checked = False
  391. 	PathHDDStorage.innerHTML          = "&nbsp;"
  392. '	SpaceHDDStorageGB.innerHTML       = "&nbsp;"
  393. 	SpaceHDDStorage.innerHTML         = 0
  394.  
  395. 	RadioButtonBackupMediaNetwork.checked = False
  396. 	PathNetworkStorage.innerHTML          = "&nbsp;"
  397. '	SpaceNetworkStorageGB.innerHTML       = "&nbsp;"
  398. 	SpaceNetworkStorage.innerHTML         = 0
  399.  
  400. 	' This dictionary will contain all Cloud Storage Service names (keys) and paths to shared folders (values)
  401. 	Set gvaCloudStorage = Nothing
  402. 	Set gvaCloudStorage = CreateObject( "Scripting.Dictionary" )
  403. 	gvaCloudStorage.RemoveAll
  404.  
  405. 	' This dictionary will contain all Removable Media names (keys) and paths (values)
  406. 	Set gvaRemovableStorage = Nothing
  407. 	Set gvaRemovableStorage = CreateObject( "Scripting.Dictionary" )
  408. 	gvaRemovableStorage.RemoveAll
  409.  
  410. 	' This dictionary will contain all removable Backup Media names (keys) and volume serial numbers (values)
  411. 	Set gvaVolumeSerials = Nothing
  412. 	Set gvaVolumeSerials = CreateObject( "Scripting.Dictionary" )
  413. 	gvaVolumeSerials.RemoveAll
  414.  
  415. 	' Check for cloud storage
  416. 	ListCloudStorage
  417.  
  418. 	' Check for removable harddisks
  419. 	ListUSBDrives
  420. End Sub
  421.  
  422.  
  423. Sub ListCloudStorage( )
  424. 	Dim objOption, strKey
  425. 	GetDropbox
  426. 	GetGoogleDrive
  427. 	GetSkyDrive
  428. 	GetSync
  429. 	DropdownCloudMedia.innerHTML = ""
  430. 	If gvaCloudStorage.Count > 1 Then
  431. 		Set objOption = document.createElement( "OPTION" )
  432. 		objOption.Text  = "-- Select a cloud storage service --"
  433. 		objOption.Value = ""
  434. 		DropdownCloudMedia.Add( objOption )
  435. 	End If
  436. 	For Each strKey In gvaCloudStorage.Keys
  437. 		RowBackupMediaCloud.style.display = "table-row"
  438. 		Set objOption = document.createElement( "OPTION" )
  439. 		objOption.Text  = strKey
  440. 		objOption.Value = gvaCloudStorage.Item( strKey )
  441. 		DropdownCloudMedia.Add( objOption )
  442. 	Next
  443. End Sub
  444.  
  445.  
  446. Sub ListSpecialFolders( )
  447. 	Dim arrKnownFolders, arrValueNames, arrValueTypes
  448. 	Dim i, intLength
  449. 	Dim objReg, wshShell
  450. 	Dim strKey, strKeyNS, strRegPath, strValue
  451. 	Set gvaSpecialFolders = CreateObject( "System.Collections.Sortedlist" )
  452. 	Set wshShell          = CreateObject( "WScript.Shell" )
  453. 	' Get a list of special folders known by the wshShell object
  454. 	arrKnownFolders = Split( "AllUsersDesktop,AllUsersStartMenu,AllUsersPrograms,AllUsersStartup,Desktop,Favorites,Fonts,MyDocuments,NetHood,PrintHood,Programs,Recent,SendTo,StartMenu,Startup,Templates", "," )
  455. 	For i = 0 To UBound( arrKnownFolders )
  456. 		strKey   = arrKnownFolders(i)
  457. 		strValue = wshShell.SpecialFolders.Item( strKey )
  458. 		gvaSpecialFolders.Item( strKey ) = strValue
  459. 	Next
  460. 	' Find more special folders, personal, unknown to the wshShell object
  461. 	Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv" )
  462. 	strRegPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
  463. 	objReg.EnumValues HKEY_CURRENT_USER, strRegPath, arrValueNames, arrValueTypes
  464. 	For i = 0 To UBound( arrValueNames )
  465. 		If arrValueTypes(i) = REG_SZ Then
  466. 			strKey   = arrValueNames(i)
  467. 			strKeyNS = Replace( strKey, " ", "" )
  468. 			strValue = ""
  469. 			If Left( strKey, 1 ) <> "{" Then
  470. 				If Left( strKey, 1 ) <> "!" Then
  471. 					If Not gvaSpecialFolders.ContainsKey( strKeyNS ) Then
  472. 						objReg.GetStringValue HKEY_CURRENT_USER, strRegPath, strKey, strValue
  473. 						If trim( " " & strValue ) <> "" Then
  474. 							gvaSpecialFolders.Item( strKeyNS ) = strValue
  475. 						End If
  476. 					End If
  477. 				End If
  478. 			End If
  479. 		End If
  480. 	Next
  481. 	' Find more special folders, common, unknown to the wshShell object
  482. 	strRegPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
  483. 	objReg.EnumValues HKEY_LOCAL_MACHINE, strRegPath, arrValueNames, arrValueTypes
  484. 	For i = 0 To UBound( arrValueNames )
  485. 		If arrValueTypes(i) = REG_SZ Then
  486. 			strKey   = arrValueNames(i)
  487. 			strKeyNS = Replace( strKey, " ", "" )
  488. 			strValue = ""
  489. 			If Left( strKey, 1 ) <> "{" Then
  490. 				If Left( strKey, 1 ) <> "!" Then
  491. 					If Not gvaSpecialFolders.ContainsKey( strKeyNS ) Then
  492. 						objReg.GetStringValue HKEY_CURRENT_USER, strRegPath, strKey, strValue
  493. 						If trim( " " & strValue ) <> "" Then
  494. 							gvaSpecialFolders.Item( strKeyNS ) = strValue
  495. 						End If
  496. 					End If
  497. 				End If
  498. 			End If
  499. 		End If
  500. 	Next
  501. 	If Not gvaSpecialFolders.ContainsKey( "MyDocuments" ) Then
  502. 		If gvaSpecialFolders.ContainsKey( "Documents" ) Then
  503. 			gvaSpecialFolders.Item( "MyDocuments" ) = gvaSpecialFolders.Item( "Documents" )
  504. 		End If
  505. 	End If
  506. 	If Not gvaSpecialFolders.ContainsKey( "MyMusic" ) Then
  507. 		If gvaSpecialFolders.ContainsKey( "Music" ) Then
  508. 			gvaSpecialFolders.Item( "MyMusic" ) = gvaSpecialFolders.Item( "Music" )
  509. 		End If
  510. 	End If
  511. 	If Not gvaSpecialFolders.ContainsKey( "MyPictures" ) Then
  512. 		If gvaSpecialFolders.ContainsKey( "Pictures" ) Then
  513. 			gvaSpecialFolders.Item( "MyPictures" ) = gvaSpecialFolders.Item( "Pictures" )
  514. 		End If
  515. 	End If
  516. 	If Not gvaSpecialFolders.ContainsKey( "MyVideos" ) Then
  517. 		If gvaSpecialFolders.ContainsKey( "Videos" ) Then
  518. 			gvaSpecialFolders.Item( "MyVideos" ) = gvaSpecialFolders.Item( "Videos" )
  519. 		End If
  520. 	End If
  521. 	If Not gvaSpecialFolders.ContainsKey( "MyVideos" ) Then
  522. 		If gvaSpecialFolders.ContainsKey( "MyVideo" ) Then
  523. 			gvaSpecialFolders.Item( "MyVideos" ) = gvaSpecialFolders.Item( "MyVideo" )
  524. 		End If
  525. 	End If
  526. 	Set objReg   = Nothing
  527. 	Set wshShell = Nothing
  528. End Sub
  529.  
  530.  
  531. Sub ListUSBDrives( )
  532. 	Dim colDiskPartitions, colUSBDiskDrives, colLogicalDisks, objDiskPartition, objLogicalDisk, objOption, objUSBDiskDrive, objWMIService
  533. 	Dim strDeviceID, strDiskPartition, strInterface, strKey, strLogicalDisk, strModel, strQuery1, strQuery2, strQuery3, strVolumeSerial
  534. 	DropdownUSBMedia.innerHTML = ""
  535. 	Set objWMIService = GetObject( "winmgmts://./root/CIMV2" )
  536. 	' Select all DISKS with USB or FireWire interface
  537. 	strQuery1 = "SELECT * FROM Win32_DiskDrive WHERE ( InterfaceType = 'USB' OR InterfaceType = '1394' ) AND Partitions > 0"
  538. 	Set colUSBDiskDrives = objWMIService.ExecQuery( strQuery1 )
  539. 	For Each objUSBDiskDrive In colUSBDiskDrives
  540. 		strDeviceID  = objUSBDiskDrive.DeviceID
  541. 		strModel     = objUSBDiskDrive.Model
  542. 		strInterface = objUSBDiskDrive.InterfaceType
  543. 		' Link the disk's device IDs to partitions
  544. 		strQuery2 = "ASSOCIATORS OF {Win32_DiskDrive.DeviceID='" & strDeviceID & "'} WHERE AssocClass=Win32_DiskDriveToDiskPartition"
  545. 		Set colDiskPartitions = objWMIService.ExecQuery( strQuery2 )
  546. 		For Each objDiskPartition In colDiskPartitions
  547. 			strDiskPartition = objDiskPartition.DeviceID
  548. 			' Link the partitions to logical drives (drive letters)
  549. 			strQuery3 = "ASSOCIATORS OF {Win32_DiskPartition.DeviceID='" & strDiskPartition & "'} WHERE AssocClass=Win32_LogicalDiskToPartition"
  550. 			Set colLogicalDisks = objWMIService.ExecQuery( strQuery3 )
  551. 			For Each objLogicalDisk In colLogicalDisks
  552. 				strLogicalDisk  = objLogicalDisk.Name
  553. 				strVolumeSerial = objLogicalDisk.VolumeSerialNumber
  554. 				gvaRemovableStorage.Item( strModel ) = strLogicalDisk & "\"
  555. 				gvaVolumeSerials.Item( strModel )    = strVolumeSerial
  556. 			Next
  557. 		Next
  558. 	Next
  559. 	If gvaRemovableStorage.Count > 1 Then
  560. 		Set objOption = document.createElement( "OPTION" )
  561. 		objOption.Text  = "-- Select a removable drive --"
  562. 		objOption.Value = ""
  563. 		DropdownUSBMedia.Add( objOption )
  564. 	End If
  565. 	For Each strKey In gvaRemovableStorage.Keys
  566. 		Set objOption = document.createElement( "OPTION" )
  567. 		objOption.Text  = strKey
  568. 		objOption.Value = gvaRemovableStorage.Item( strKey )
  569. 		DropdownUSBMedia.Add( objOption )
  570. 		RowBackupMediaUSB.style.display = "table-row"
  571. 	Next
  572. End Sub
  573.  
  574.  
  575. Sub MarkRedIfInsufficient( myTableCell )
  576. 	Dim intAvailable, objTableCell, objTableCellGB, intRequired
  577. 	Set objTableCell   = document.getElementById( myTableCell )
  578. 	Set objTableCellGB = document.getElementById( myTableCell & "GB" )
  579. 	intAvailable = objTableCell.innerHTML
  580. 	intRequired  = gviTotalSize
  581. 	If intAvailable <> "" Then
  582. 		If CDbl( intAvailable ) < CDbl( gviTotalSize ) Then
  583. 			objTableCellGB.style.color = "red"
  584. 		Else
  585. 			objTableCellGB.style.color = "black"
  586. 		End If
  587. 	End If
  588. End Sub
  589.  
  590.  
  591. Function RequiredSpace( myStartFolder )
  592. 	Dim intSize, objFile, objFolder, objFSO, objSubFolder
  593. 	RequiredSpace = 0
  594. 	intSize       = 0
  595. 	On Error Resume Next
  596. 	Set objFSO    = CreateObject( "Scripting.FileSystemObject" )
  597. 	Set objFolder = objFSO.GetFolder( myStartFolder )
  598. 	' Count total file size in folder
  599. 	For Each objFile In objFolder.Files
  600. 		intSize = intSize + objFile.Size
  601. 	Next
  602. 	' Recurse through subfolders
  603. 	For Each objSubFolder In objFolder.SubFolders
  604. 		intSize = intSize + RequiredSpace( objSubFolder.Path )
  605. 	Next
  606. 	Set objFolder = Nothing
  607. 	Set objFSO    = Nothing
  608. 	On Error Goto 0
  609. 	RequiredSpace = intSize
  610. End Function
  611.  
  612.  
  613. Function SelectFolder( myStartFolder, myPrompt )
  614. 	Dim intFlags, objFolder, objShell
  615. 	On Error Resume Next
  616. 	SelectFolder  = Null
  617. 	intFlags      = BROWSEFOLDER_RETURNONLYFSDIRS + BROWSEFOLDER_EDITBOX + BROWSEFOLDER_NEWDIALOGSTYLE
  618. 	Set objShell  = CreateObject( "Shell.Application" )
  619. 	Set objFolder = objShell.BrowseForFolder( 0, myPrompt, intFlags, myStartFolder )
  620. 	If IsObject( objfolder ) Then SelectFolder = objFolder.Self.Path
  621. 	Set objFolder = Nothing
  622. 	Set objshell  = Nothing
  623. 	On Error Goto 0
  624. End Function
  625.  
  626.  
  627. ' Keep it simple?
  628. Sub Step1( )
  629. 	TableStep1.style.display = "block"
  630. 	TableStep2.style.display = "none"
  631. 	TableStep3.style.display = "none"
  632. 	TableStep4.style.display = "none"
  633. 	TableStep5.style.display = "none"
  634. 	TableStep6.style.display = "none"
  635. 	HelpText.innerHTML       = gvaHelpText.Item( "Step1" )
  636. 	Step1_DisplayBasicOrAdvanced
  637. End Sub
  638.  
  639.  
  640. Sub Step1_DisplayBasicOrAdvanced( )
  641. 		RowStep3_ShowFullPath.style.display = "none"
  642. 	If RadioBasic.checked Then
  643. 		gvbAdvancedInstall = False
  644. 		gvbStep1Ready      = True
  645. 	ElseIf RadioAdvanced.checked Then
  646. 		gvbAdvancedInstall = True
  647. 		gvbStep1Ready      = True
  648. 		RowStep3_ShowFullPath.style.display = "block"
  649. 	Else
  650. 		gvbAdvancedInstall = False
  651. 		gvbStep1Ready      = False
  652. 	End If
  653. 	ButtonBack.disabled = True
  654. 	ButtonNext.disabled = Not gvbStep1Ready
  655. End Sub
  656.  
  657.  
  658. ' Backup Job
  659. Sub Step2( )
  660. 	TableStep1.style.display = "none"
  661. 	TableStep2.style.display = "block"
  662. 	TableStep3.style.display = "none"
  663. 	TableStep4.style.display = "none"
  664. 	TableStep5.style.display = "none"
  665. 	TableStep6.style.display = "none"
  666. 	ButtonBack.disabled = False
  667. 	ButtonNext.disabled = True
  668. 	If gvbAdvancedInstall Then
  669. 		HelpText.innerHTML = gvaHelpText.Item( "Step2Advanced" )
  670. 	Else
  671. 		HelpText.innerHTML = gvaHelpText.Item( "Step2Basic" )
  672. 	End If
  673. 	If gvbAdvancedInstall Then
  674. 		On Error Resume Next
  675. 		RowExistingJobs.style.display = "table-row"
  676. 		RowExistingJobs.style.display = "block"
  677. 		On Error Goto 0
  678. 		Step2_ListExistingBackupJobs
  679. 	Else
  680. 		RowExistingJobs.style.display = "none"
  681. 		RadioNewBackupJob.checked     = True
  682. 	End If
  683. 	Step2_DisplayBackupJobs
  684. End Sub
  685.  
  686.  
  687. Sub Step2_CheckNameOfNewJob( )
  688. 	Dim objOption
  689. 	If RadioNewBackupJob.checked Then
  690. 		If NameOfNewBackupJob.value = "New Backup Job" Then
  691. 			ButtonNext.disabled = True
  692. 		Else
  693. 			ButtonNext.disabled = False
  694. 		End If
  695. 	End If
  696. 	If RadioExistingBackupJob.checked Then
  697. 		For Each objOption In ListOfExistingJobs.options
  698. 			If objOption.selected Then
  699. 				If objOption.value = "" Then
  700. 					ButtonNext.disabled    = True
  701. 				Else
  702. 					gvsExistingBackupJobID = objOption.value
  703. 					ButtonNext.disabled    = False
  704. 				End If
  705. 			End If
  706. 		Next
  707. 	End If
  708. End Sub
  709.  
  710.  
  711. Sub Step2_DisplayBackupJobs( )
  712. 	Dim objOption
  713. 	gvbEditExistingJob  = RadioExistingBackupJob.checked
  714. 	ButtonBack.disabled = False
  715. 	If RadioNewBackupJob.checked Then
  716. 		NameOfNewBackupJob.style.display = "inline"
  717. 		NewBackupJobID.innerHTML         = Step2_GenerateNewBackupJobID( )
  718. 		ExistingBackupJobID.innerHTML    = ""
  719. 		If gvbAdvancedInstall Then
  720. 			HelpText.innerHTML = gvaHelpText.Item( "Step2AdvancedNew" )
  721. 		Else
  722. 			HelpText.innerHTML = gvaHelpText.Item( "Step2Basic" )
  723. 		End If
  724. 	Else
  725. 		NameOfNewBackupJob.style.display = "none"
  726. 		NewBackupJobID.innerHTML         = ""
  727. 	End If
  728. 	If RadioExistingBackupJob.checked Then
  729. 		ListOfExistingJobs.style.display = "inline"
  730. 		NewBackupJobID.innerHTML         = ""
  731. 		For Each objOption In ListOfExistingJobs.options
  732. 			If objOption.selected Then
  733. 				ExistingBackupJobID.innerHTML = objOption.value
  734. 			End If
  735. 		Next
  736. 		If gvbAdvancedInstall Then
  737. 			HelpText.innerHTML = gvaHelpText.Item( "Step2AdvancedExisting" )
  738. 		Else
  739. 			HelpText.innerHTML = gvaHelpText.Item( "Step2Basic" )
  740. 		End If
  741. 		ButtonBack.disabled = True
  742. 	Else
  743. 		ListOfExistingJobs.style.display = "none"
  744. 		ExistingBackupJobID.innerHTML    = ""
  745. 	End If
  746. 	Step2_CheckNameOfNewJob
  747. End Sub
  748.  
  749.  
  750. Function Step2_GenerateNewBackupJobID( )
  751. 	Dim dblJobID, strJobIDHex
  752. 	Step2_GenerateNewBackupJobID = ""
  753. 	On Error Resume Next
  754. 	dblJobID    = ( ( ( ( ( Year( Now ) - 2010 ) * 12 + Month( Now ) ) * 31 + Day( Now ) ) * 24 + Hour( Now ) ) * 60 + Minute( Now ) ) * 10 + ( Second( Now ) / 6 ) ' 6 second interval
  755. 	strJobIDHex = Hex( dblJobID )
  756. 	If Err Then MsgBox "Error while generating the Backup Job ID", vbOKOnly + vbExclamation + vbApplicationModal, "Hex Overflow"
  757. 	On Error Goto 0
  758. 	Step2_GenerateNewBackupJobID = strJobIDHex
  759. End Function
  760.  
  761.  
  762. Sub Step2_ListExistingBackupJobs( )
  763. 	Dim arrSubkeys, arrValueNames, arrValueTypes
  764. 	Dim objOption, objReg
  765. 	Dim strBackupDescr, strBackupID, strBackupJob, strRegPath
  766. 	Dim objDictionary
  767. 	Set gvaBackupJobs = CreateObject( "Scripting.Dictionary" )
  768. 	strRegPath = "SOFTWARE\robvanderwoude.com\Backup\BackupJobs"
  769. 	Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv" )
  770. 	On Error Resume Next
  771. 	objReg.EnumKey HKEY_CURRENT_USER, strRegPath, arrSubkeys
  772. 	If Not Err And Not IsNull( arrSubkeys ) And IsArray( arrSubkeys ) Then
  773. 		For Each strBackupJob In arrSubkeys
  774. 			strBackupDescr = "Unnamed Backup Job"
  775. 			objReg.GetStringValue HKEY_CURRENT_USER, strRegPath & "\" & strBackupJob, "Description", strBackupDescr
  776. 			gvaBackupJobs.Item( strBackupJob ) = strBackupDescr
  777. 		Next
  778. 	End If
  779. 	On Error Goto 0
  780. 	Set objReg = Nothing
  781. 	ListOfExistingJobs.innerHTML = ""
  782. 	If gvaBackupJobs.Count > 0 Then
  783. 		RadioExistingBackupJob.disabled = False
  784. 		If gvaBackupJobs.Count > 1 Then
  785. 			Set objOption = document.createElement( "OPTION" )
  786. 			objOption.text  = "-- Select a backup job --"
  787. 			objOption.value = ""
  788. 			ListOfExistingJobs.Add( objOption )
  789. 		End If
  790. 		For Each strBackupJob In gvaBackupJobs.Keys
  791. 			Set objOption = document.createElement( "OPTION" )
  792. 			strBackupDescr  = gvaBackupJobs.Item( strBackupJob )
  793. 			objOption.text  = strBackupDescr & " (" & strBackupJob & ")"
  794. 			objOption.value = strBackupJob
  795. 			ListOfExistingJobs.Add( objOption )
  796. 		Next
  797. 	Else
  798. 		RadioNewBackupJob.checked    = True
  799. 		RadioExistingBackupJob.title = "Sorry, no existing backup jobs were found"
  800. 		LabelExistingBackupJob.title = "Sorry, no existing backup jobs were found"
  801. 		Step2_DisplayBackupJobs
  802. 	End If
  803. End Sub
  804.  
  805.  
  806. ' What To Backup
  807. Sub Step3( )
  808. 	Dim blnMediaSelected, blnMediaSelectedCloud, blnMediaSelectedHDD, blnMediaSelectedNetwork, blnMediaSelectedUSB
  809. 	Dim strDocuments, strMusic, strPictures, strVideos
  810. 	TableStep1.style.display = "none"
  811. 	TableStep2.style.display = "none"
  812. 	TableStep3.style.display = "block"
  813. 	TableStep4.style.display = "none"
  814. 	TableStep5.style.display = "none"
  815. 	TableStep6.style.display = "none"
  816. 	If gvbAdvancedInstall Then
  817. 		HelpText.innerHTML = gvaHelpText.Item( "Step3Advanced" )
  818. 	Else
  819. 		HelpText.innerHTML = gvaHelpText.Item( "Step3Basic" )
  820. 	End If
  821. 	ButtonBack.disabled = True
  822. 	ButtonNext.disabled = True
  823. 	strDocuments  = gvaSpecialFolders.Item( "MyDocuments" )
  824. 	strMusic      = gvaSpecialFolders.Item( "MyMusic" )
  825. 	strPictures   = gvaSpecialFolders.Item( "MyPictures" )
  826. 	strVideos     = gvaSpecialFolders.Item( "MyVideo" )
  827. 	If IsNull( strDocuments ) Then
  828. 		document.getElementById( "CheckboxIncludeDocuments" ).checked = False
  829. 	Else
  830. '		PathDocuments.innerHTML = strDocuments
  831. '		window.setTimeout "Step3_ShowSize """ & strDocuments & """, ""SizeDocuments""", 1000, "VBScript"
  832. 	End If
  833. 	If IsNull( strMusic ) Then
  834. 		document.getElementById( "CheckboxIncludeMusic" ).checked = False
  835. 	Else
  836. '		PathMusic.innerHTML = strMusic
  837. '		window.setTimeout "Step3_ShowSize """ & strMusic & """, ""SizeMusic""", 1000, "VBScript"
  838. 	End If
  839. 	If IsNull( strPictures ) Then
  840. 		document.getElementById( "CheckboxIncludePictures" ).checked = False
  841. 	Else
  842. '		PathPictures.innerHTML = strPictures
  843. '		window.setTimeout "Step3_ShowSize """ & strPictures  & """, ""SizePictures""", 1000, "VBScript"
  844. 	End If
  845. 	If IsNull( strVideos ) Then
  846. 		document.getElementById( "CheckboxIncludeVideos" ).checked = False
  847. 	Else
  848. '		PathVideos.innerHTML = strVideos
  849. '		window.setTimeout "Step3_ShowSize """ & strVideos & """, ""SizeVideos""", 1000, "VBScript"
  850. 	End If
  851. 	If gvbEditExistingJob Then
  852. 		Step3_ExistingBackupJobSelection
  853. 	End If
  854. 	blnMediaSelectedCloud   = RadioButtonBackupMediaCloud.checked   And ( SpaceCloudStorage.innerHTML   > "0" )
  855. 	blnMediaSelectedHDD     = RadioButtonBackupMediaHDD.checked     And ( SpaceHDDStorage.innerHTML     > "0" )
  856. 	blnMediaSelectedNetwork = RadioButtonBackupMediaNetwork.checked And ( SpaceNetworkStorage.innerHTML > "0" )
  857. 	blnMediaSelectedUSB     = RadioButtonBackupMediaUSB.checked     And ( SpaceUSBStorage.innerHTML     > "0" )
  858. 	blnMediaSelected        = blnMediaSelectedCloud Or blnMediaSelectedHDD Or blnMediaSelectedNetwork Or blnMediaSelectedUSB
  859. 	If Not blnMediaSelected Then
  860. 		window.setTimeout "ListBackupMedia", 100, "VBScript"
  861. 	End If
  862. 	ButtonBack.disabled = False
  863. 	ButtonNext.disabled = False
  864. 	'gviInterval = window.setInterval( "TotalSize", 5000, "VBScript" )
  865. End Sub
  866.  
  867.  
  868. Sub Step3_AddCustomFolder( num, myPath )
  869. 	Dim objButtonAdd, objButtonRemove, objCheckbox, objFSO, objName, objNextRow, objPath, objSize, objSizeGB
  870. 	Dim strFolder, strName
  871. 	Set objButtonAdd    = document.getElementById( "ButtonIncludeCustom" & num )
  872. 	Set objButtonRemove = document.getElementById( "ButtonExcludeCustom" & num )
  873. 	Set objCheckbox     = document.getElementById( "CheckboxIncludeCustom" & num )
  874. 	Set objName         = document.getElementById( "NameCustom" & num )
  875. '	Set objPath         = document.getElementById( "PathCustom" & num )
  876. '	Set objSize         = document.getElementById( "SizeCustom" & num )
  877. '	Set objSizeGB       = document.getElementById( "SizeCustom" & num & "GB" )
  878. 	If IsNull( myPath ) Then
  879. 		strFolder = SelectFolder( BROWSEFOLDER_DRIVES, "Select a folder to include in the backup" )
  880. 	Else
  881. 		strFolder = myPath
  882. 	End If
  883. 	If IsNull( strFolder ) Then
  884. 		gvaCustomPath( num )          = ""
  885. 		objCheckbox.checked           = False
  886. 		objCheckbox.disabled          = True
  887. '		objPath.innerHTML             = ""
  888. 		objButtonAdd.style.display    = "inline"
  889. 		objButtonRemove.style.display = "none"
  890. 	Else
  891. 		Set objFSO = CreateObject( "Scripting.FileSystemObject" )
  892. 		gvaCustomPath( num )          = strFolder
  893. 		strName                       = objFSO.GetFileName( strFolder )
  894. 		Set objFSO = Nothing
  895. 		objCheckbox.checked           = True
  896. 		objCheckbox.disabled          = False
  897. 		If CheckboxShowFullPath.checked Then
  898. 			objName.innerHTML         = strFolder
  899. 		Else
  900. 			objName.innerHTML         = strName
  901. 		End If
  902. '		objPath.innerHTML             = strFolder
  903. 		objButtonAdd.style.display    = "none"
  904. 		objButtonRemove.style.display = "inline"
  905. 		If num < 4 Then
  906. 			Set objNextRow = document.getElementById( "CustomRow" & ( 1 + num ) )
  907. 			objNextRow.style.display      = "table-row"
  908. 			objNextRow.style.visibility   = "visible"
  909. 		End If
  910. '		objSizeGB.innerHTML = "calculating..."
  911. '		window.setTimeout "Step3_ShowSize """ & strFolder & """, ""SizeCustom" & num & """",  500, "VBScript"
  912. 	End If
  913. 	HelpText.innerHTML = ""
  914. End Sub
  915.  
  916.  
  917. Sub Step3_ExistingBackupJobSelection( )
  918. 	Dim arrJobSourceDirs
  919. 	Dim blnError, blnMyDocuments, blnMyMusic, blnMyPictures, blnMyVideos
  920. 	Dim i, intCustom
  921. 	Dim strCustom1, strCustom2, strCustom3, strCustom4, strJobDescription, strRegKey
  922. 	Dim wshShell
  923. 	blnMyDocuments = False
  924. 	blnMyMusic     = False
  925. 	blnMyPictures  = False
  926. 	blnMyVideos    = False
  927. 	strRegKey      = "HKEY_CURRENT_USER\Software\robvanderwoude.com\Backup\BackupJobs\" & gvsExistingBackupJobID
  928. 	Set wshShell = CreateObject( "WScript.Shell" )
  929. 	On Error Resume Next
  930. 	' auto;logoff;logon;manual;schedule
  931. 	gvaExistingJobBackupTypes = Split( wshShell.RegRead( strRegKey & "\BackupTypes" ), ";" )
  932. 	' HOUR;minute or DAY;hour;minute or WEEK;dayofweek;hour;minute or MONTH;dayofmonth;hour;minute
  933. 	gvaExistingJobScheduleInt = Split( wshShell.RegRead( strRegKey & "\ScheduleInterval" ), ";" )
  934. 	' Number of days when a backup is considered overdue
  935. 	gvaExistingJobReminderInt = wshShell.RegRead( strRegKey & "\ReminderDays" )
  936. 	' MYDOCUMENTS;MYMUSIC;MYPICTURES;MYVIDEOS;custom1;custom2;custom3;custom4
  937. 	arrJobSourceDirs  = Split( wshShell.RegRead( strRegKey & "\SourceDirs" ), ";" )
  938. 	' Backup job name
  939. 	strJobDescription = wshShell.RegRead( strRegKey & "\Description" )
  940. 	' Path without drive letter for removable, full path for others
  941. 	gvsExistingJobTargetDir = wshShell.RegRead( strRegKey & "\TargetDir" )
  942. 	' cloud;local;network;removable
  943. 	gvsExistingJobTargetType = wshShell.RegRead( strRegKey & "\TargetType" )
  944. 	' 8 digits hexadecimal volume serial
  945. 	gvsExistingJobTargetVol = wshShell.RegRead( strRegKey & "\TargetVolumeSerial" )
  946. 	' Number of days to keep backups
  947. 	gviExistingJobRetentionDays = wshShell.RegRead( strRegKey & "\RetentionDays" )
  948. 	' Number of backups to keep
  949. 	gviExistingJobRotationNumber = wshShell.RegRead( strRegKey & "\RotationNumber" )
  950. 	On Error Goto 0
  951. 	Set wshShell = Nothing
  952. 	' Select sourcedirs specified by existing job
  953. 	intCustom = 0
  954. 	For i = 0 To UBound( arrJobSourceDirs )
  955. 		Select Case arrJobSourceDirs(i)
  956. 			Case "MYDOCUMENTS":
  957. 				blnMyDocuments = True
  958. 			Case "MYMUSIC":
  959. 				blnMyMusic     = True
  960. 			Case "MYPICTURES":
  961. 				blnMyPictures  = True
  962. 			Case "MYVIDEOS":
  963. 				blnMyVideos    = True
  964. 			Case Else
  965. 				intCustom = intCustom + 1
  966. 				Select Case intCustom
  967. 					Case 1:
  968. 						strCustom1 = arrJobSourceDirs(i)
  969. 						Step3_AddCustomFolder 1, strCustom1
  970. 					Case 2:
  971. 						strCustom2 = arrJobSourceDirs(i)
  972. 						Step3_AddCustomFolder 2, strCustom2
  973. 					Case 3:
  974. 						strCustom3 = arrJobSourceDirs(i)
  975. 						Step3_AddCustomFolder 3, strCustom3
  976. 					Case 4:
  977. 						strCustom4 = arrJobSourceDirs(i)
  978. 						Step3_AddCustomFolder 4, strCustom4
  979. 					Case Else:
  980. 						blnError   = True
  981. 				End Select
  982. 		End Select
  983. 	Next
  984. 	CheckboxIncludeDocuments.checked = blnMyDocuments
  985. 	CheckboxIncludeMusic.checked     = blnMyMusic
  986. 	CheckboxIncludePictures.checked  = blnMyPictures
  987. 	CheckboxIncludeVideos.checked    = blnMyVideos
  988. End Sub
  989.  
  990.  
  991. Sub Step3_RemoveCustomFolder( num )
  992. 	Dim objButtonAdd, objButtonRemove, objCheckbox, objName, objPath, objSize, objSizeGB
  993. 	Dim strFolder
  994. 	gvaCustomPath( num ) = ""
  995. 	Set objButtonAdd     = document.getElementById( "ButtonIncludeCustom" & num )
  996. 	Set objButtonRemove  = document.getElementById( "ButtonExcludeCustom" & num )
  997. 	Set objCheckbox      = document.getElementById( "CheckboxIncludeCustom" & num )
  998. 	Set objName          = document.getElementById( "NameCustom" & num )
  999. '	Set objPath          = document.getElementById( "PathCustom" & num )
  1000. '	Set objSize          = document.getElementById( "SizeCustom" & num )
  1001. '	Set objSizeGB        = document.getElementById( "SizeCustom" & num & "GB" )
  1002. 	objCheckbox.checked           = False
  1003. 	objCheckbox.disabled          = True
  1004. 	objName.innerHTML             = ""
  1005. '	objPath.innerHTML             = ""
  1006. 	objButtonAdd.style.display    = "inline"
  1007. 	objButtonRemove.style.display = "none"
  1008. '	objSize.innerHTML    = "0"
  1009. '	objSizeGB.innerHTML  = ""
  1010. 	TotalSize
  1011. End Sub
  1012.  
  1013.  
  1014. Sub Step3_ShowFullPath( )
  1015. 	Dim objFSO
  1016. 	If CheckboxShowFullPath.checked Then
  1017. 		LabelIncludeDocuments.innerHTML = gvaSpecialFolders.Item( "MyDocuments" )
  1018. 		LabelIncludeMusic.innerHTML     = gvaSpecialFolders.Item( "MyMusic" )
  1019. 		LabelIncludePictures.innerHTML  = gvaSpecialFolders.Item( "MyPictures" )
  1020. 		LabelIncludeVideos.innerHTML    = gvaSpecialFolders.Item( "MyVideos" )
  1021. 		NameCustom1.innerHTML           = gvaCustomPath(1)
  1022. 		NameCustom2.innerHTML           = gvaCustomPath(2)
  1023. 		NameCustom3.innerHTML           = gvaCustomPath(3)
  1024. 		NameCustom4.innerHTML           = gvaCustomPath(4)
  1025.  
  1026. '		PathDocuments
  1027. '		SizeDocumentsGB
  1028. '		SizeDocuments
  1029. '		PathMusic
  1030. '		SizeMusicGB
  1031. '		SizeMusic
  1032. '		PathPictures
  1033. '		SizePicturesGB
  1034. '		SizePictures
  1035. '		PathVideos
  1036. '		SizeVideosGB
  1037. '		SizeVideos
  1038.  
  1039. '		NameCustom1
  1040. '		PathCustom1
  1041. '		SizeCustom1GB
  1042. '		SizeCustom1
  1043. '		NameCustom2
  1044. '		PathCustom2
  1045. '		SizeCustom2GB
  1046. '		SizeCustom2
  1047. '		NameCustom3
  1048. '		PathCustom3
  1049. '		SizeCustom3GB
  1050. '		SizeCustom3
  1051. '		NameCustom4
  1052. '		PathCustom4
  1053. '		SizeCustom4GB
  1054. '		SizeCustom4
  1055. 	Else
  1056. 		Set objFSO = CreateObject( "Scripting.FileSystemObject" )
  1057. 		LabelIncludeDocuments.innerHTML = "My Documents"
  1058. 		LabelIncludeMusic.innerHTML     = "My Music"
  1059. 		LabelIncludePictures.innerHTML  = "My Pictures"
  1060. 		LabelIncludeVideos.innerHTML    = "My Videos"
  1061. 		NameCustom1.innerHTML           = objFSO.GetFileName( gvaCustomPath(1) )
  1062. 		NameCustom2.innerHTML           = objFSO.GetFileName( gvaCustomPath(2) )
  1063. 		NameCustom3.innerHTML           = objFSO.GetFileName( gvaCustomPath(3) )
  1064. 		NameCustom4.innerHTML           = objFSO.GetFileName( gvaCustomPath(4) )
  1065. 		Set objFSO = Nothing
  1066. 	End If
  1067. End Sub
  1068.  
  1069.  
  1070. Sub Step3_ShowSize( myFolder, myElement )
  1071. 	Dim intSize
  1072. 	intSize = RequiredSpace( myFolder )
  1073. 	document.getElementById( myElement ).innerHTML        = intSize
  1074. 	document.getElementById( myElement & "GB" ).innerHTML = GB( intSize, 0 )
  1075. 	TotalSize
  1076. End Sub
  1077.  
  1078.  
  1079. ' Where To Backup
  1080. Sub Step4( )
  1081. 	Dim objOption, objDropdown, strBackupDisk, strKey
  1082. 	TableStep1.style.display = "none"
  1083. 	TableStep2.style.display = "none"
  1084. 	TableStep3.style.display = "none"
  1085. 	TableStep4.style.display = "block"
  1086. 	TableStep5.style.display = "none"
  1087. 	TableStep6.style.display = "none"
  1088. 	HelpText.innerHTML = gvaHelpText.Item( "Step4" )
  1089. 	On Error Resume Next
  1090. 	If gvbAdvancedInstall Then
  1091. 		RowBackupMediaNetwork.style.display = "table-row"
  1092. 		RowBackupMediaNetwork.style.display = "block"
  1093. 	Else
  1094. 		RowBackupMediaNetwork.style.display = "none"
  1095. 	End If
  1096. 	ButtonBack.disabled = False
  1097. 	ButtonNext.disabled = True
  1098. 	' Select targetdir specified by existing job
  1099. 	If gvbEditExistingJob Then
  1100. 		Select Case LCase( gvsExistingJobTargetType )
  1101. 			Case "cloud":
  1102. 				RadioButtonBackupMediaCloud.checked   = True
  1103. 				Set objDropdown = document.getElementById( "DropdownCloudMedia" )
  1104. 			Case "local":
  1105. 				RadioButtonBackupMediaHDD.checked     = True
  1106. 			Case "network":
  1107. 				RadioButtonBackupMediaNetwork.checked = True
  1108. 			Case "removable":
  1109. 				RadioButtonBackupMediaUSB.checked     = True
  1110. 				Set objDropdown = document.getElementById( "DropdownUSBMedia" )
  1111. 			Case Else
  1112. 				' Error
  1113. 		End Select
  1114. 		If RadioButtonBackupMediaCloud.checked Or RadioButtonBackupMediaUSB.checked Then
  1115. 			For Each strKey In gvaVolumeSerials.Keys
  1116. 				If UCase( gvaVolumeSerials.Item( strKey ) ) = UCase( gvsExistingJobTargetVol ) Then
  1117. 					strBackupDisk = strKey
  1118. 				End If
  1119. 			Next
  1120. 			objDropdown.style.display = "inline"
  1121. 			For Each objOption In objDropdown.options
  1122. 				If objOption.text = strBackupDisk Then
  1123. 					objOption.selected = True
  1124. 				End If
  1125. 			Next
  1126. 		End If
  1127. 		ButtonNext.disabled = False
  1128. 	End If
  1129. 	On Error Goto 0
  1130. End Sub
  1131.  
  1132.  
  1133. Sub Step4_ChooseSubfolder( )
  1134. 	Dim objFSO, objOption
  1135. 	Dim strFolder, strMedium, strRoot
  1136. 	Set objFSO = CreateObject( "Scripting.FileSystemObject" )
  1137. 	For Each objOption In ListOfBackupMedia.options
  1138. 		If objOption.selected Then
  1139. 			strMedium = objOption.text
  1140. 			strRoot   = objOption.value
  1141. 		End If
  1142. 	Next
  1143. 	strFolder = SelectFolder( strRoot, "Select a location to store the backup scripts" )
  1144. 	PathBackup.innerHTML = strFolder
  1145. 	For Each objOption In ListOfBackupMedia.options
  1146. 		If objOption.selected Then
  1147. 			objOption.value = strFolder
  1148. 		End If
  1149. 	Next
  1150. 	Set objFSO = Nothing
  1151. End Sub
  1152.  
  1153.  
  1154. Sub Step4_ClearCloudStorage( )
  1155. 		Dim blnFirst, objOption
  1156. 		blnFirst = True
  1157. 		For Each objOption In DropdownCloudMedia.options
  1158. 			objOption.selected = blnFirst
  1159. 			blnFirst = False
  1160. 		Next
  1161. 		PathCloudStorage.innerHTML    = ""
  1162. 		SpaceCloudStorage.innerHTML   = 0
  1163. End Sub
  1164.  
  1165.  
  1166. Sub Step4_ClearHDDStorage( )
  1167. 		PathHDDStorage.innerHTML    = ""
  1168. 		SpaceHDDStorage.innerHTML   = 0
  1169. End Sub
  1170.  
  1171.  
  1172. Sub Step4_ClearNetworkStorage( )
  1173. 		PathNetworkStorage.innerHTML    = ""
  1174. 		SpaceNetworkStorage.innerHTML   = 0
  1175. End Sub
  1176.  
  1177.  
  1178. Sub Step4_ClearUSBStorage( )
  1179. 		Dim blnFirst, objOption
  1180. 		blnFirst = True
  1181. 		For Each objOption In DropdownUSBMedia.options
  1182. 			objOption.selected = blnFirst
  1183. 			blnFirst = False
  1184. 		Next
  1185. 		PathUSBStorage.innerHTML    = ""
  1186. 		SpaceUSBStorage.innerHTML   = 0
  1187. End Sub
  1188.  
  1189.  
  1190. Sub Step4_DisplayMediaChoice( )
  1191. 	Dim objOption
  1192. 	gvsTargetPath = ""
  1193. 	If RadioButtonBackupMediaCloud.checked Then
  1194. 		DropdownCloudMedia.style.display = "inline"
  1195. 		DropdownUSBMedia.style.display   = "none"
  1196. 		If gvaCloudStorage.Count = 1 Then
  1197. 			HelpText.innerHTML = gvaHelpText.Item( "Step4Subfolder" )
  1198. 			Step4_SetBackupPath
  1199. 		Else
  1200. 			HelpText.innerHTML = gvaHelpText.Item( "Step4Cloud" )
  1201. 		End If
  1202. 		Step4_ClearUSBStorage
  1203. 		Step4_ClearHDDStorage
  1204. 		Step4_ClearNetworkStorage
  1205. 	ElseIf RadioButtonBackupMediaUSB.checked Then
  1206. 		DropdownCloudMedia.style.display = "none"
  1207. 		DropdownUSBMedia.style.display   = "inline"
  1208. 		If gvaRemovableStorage.Count = 1 Then
  1209. 			HelpText.innerHTML = gvaHelpText.Item( "Step4Subfolder" )
  1210. 			Step4_SetBackupPath
  1211. 		Else
  1212. 			HelpText.innerHTML = gvaHelpText.Item( "Step4USB" )
  1213. 		End If
  1214. 		Step4_ClearCloudStorage
  1215. 		Step4_ClearHDDStorage
  1216. 		Step4_ClearNetworkStorage
  1217. 	Else
  1218. 		DropdownCloudMedia.style.display = "none"
  1219. 		DropdownUSBMedia.style.display   = "none"
  1220. 		If RadioButtonBackupMediaHDD.checked Then
  1221. 			HelpText.innerHTML = gvaHelpText.Item( "Step4HDD" )
  1222. 			Step4_ClearCloudStorage
  1223. 			Step4_ClearUSBStorage
  1224. 			Step4_ClearNetworkStorage
  1225. 			gvsPathHDDStorage = SelectFolder( BROWSEFOLDER_DRIVES, "Select a subfolder for the backup" )
  1226. 			If IsNull( gvsPathHDDStorage ) Then
  1227. 				Step4_DisplayMediaChoice
  1228. 				Exit Sub
  1229. 			End If
  1230. 			gvsTargetPath            = gvsPathHDDStorage
  1231. 			gviSpaceHDDStorage       = GetAvailableSpace( gvsPathHDDStorage )
  1232. 			PathHDDStorage.innerHTML = gvsPathHDDStorage
  1233. '			MarkRedIfInsufficient "SpaceCloudStorage"
  1234. 		ElseIf RadioButtonBackupMediaNetwork.checked Then
  1235. 			HelpText.innerHTML = gvaHelpText.Item( "Step4Network" )
  1236. 			Step4_ClearCloudStorage
  1237. 			Step4_ClearUSBStorage
  1238. 			Step4_ClearHDDStorage
  1239. 			gvsPathNetworkStorage = SelectFolder( BROWSEFOLDER_NETWORK, "Select a subfolder for the backup" )
  1240. 			If IsNull( gvsPathNetworkStorage ) Then
  1241. 				Step4_DisplayMediaChoice
  1242. 				Exit Sub
  1243. 			End If
  1244. 			gvsTargetPath                = gvsPathNetworkStorage
  1245. 			gviSpaceNetworkStorage       = GetAvailableSpace( gvsPathNetworkStorage )
  1246. 			PathNetworkStorage.innerHTML = gvsPathNetworkStorage
  1247. '			MarkRedIfInsufficient "SpaceHDDStorage"
  1248. 		End If
  1249. 	End If
  1250. 	ButtonNext.disabled = ( gvsTargetPath = "" )
  1251. End Sub
  1252.  
  1253.  
  1254. Sub Step4_SetBackupPath( )
  1255. 	Dim intSpace
  1256. 	Dim colOptions, objOption
  1257. 	Dim strMedium, strNewPath
  1258. 	If RadioButtonBackupMediaCloud.checked Then
  1259. 		Set colOptions = DropdownCloudMedia.options
  1260. 		Step4_ClearUSBStorage
  1261. 	ElseIf RadioButtonBackupMediaUSB.checked Then
  1262. 		Set colOptions = DropdownUSBMedia.options
  1263. 		Step4_ClearCloudStorage
  1264. 	Else
  1265. 		Exit Sub
  1266. 	End If
  1267. 	For Each objOption In colOptions
  1268. 		If objOption.selected Then
  1269. 			strMedium     = objOption.text
  1270. 			gvsTargetPath = objOption.value
  1271. 		End If
  1272. 	Next
  1273. 	If gvsTargetPath = "" Then
  1274. 		ButtonNext.disabled = False
  1275. 		Step4_ClearCloudStorage
  1276. 		Step4_ClearUSBStorage
  1277. 		Exit Sub
  1278. 	End If
  1279. 	strNewPath = SelectFolder( gvsTargetPath, "Select an optional subfolder" )
  1280. 	If Not IsNull( strNewPath ) Then gvsTargetPath = strNewPath
  1281. 	If RadioButtonBackupMediaCloud.checked Then
  1282. 		intSpace = GetAvailableSpace( gvsTargetPath )
  1283. 		PathCloudStorage.innerHTML    = gvsTargetPath
  1284. 		SpaceCloudStorage.innerHTML   = intSpace
  1285. '		MarkRedIfInsufficient "SpaceCloudStorage"
  1286. 	ElseIf RadioButtonBackupMediaUSB.checked Then
  1287. 		intSpace = GetAvailableSpace( gvsTargetPath )
  1288. 		PathUSBStorage.innerHTML    = gvsTargetPath
  1289. 		SpaceUSBStorage.innerHTML   = intSpace
  1290. '		MarkRedIfInsufficient "SpaceUSBStorage"
  1291. 	End If
  1292. 	ButtonNext.disabled = ( gvsTargetPath = "" )
  1293. End Sub
  1294.  
  1295.  
  1296. ' How And When To Backup
  1297. Sub Step5( )
  1298. 	Dim blnScheduleSelected, objOption
  1299. 	TableStep1.style.display = "none"
  1300. 	TableStep2.style.display = "none"
  1301. 	TableStep3.style.display = "none"
  1302. 	TableStep4.style.display = "none"
  1303. 	TableStep5.style.display = "block"
  1304. 	TableStep6.style.display = "none"
  1305. 	On Error Resume Next
  1306. 	If RadioButtonBackupMediaUSB.checked Then
  1307. 		RowOnDiskInsert.style.display = "table-row"
  1308. 		RowOnDiskInsert.style.display = "block"
  1309. 	Else
  1310. 		RowOnDiskInsert.style.display = "none"
  1311. 	End If
  1312. 	On Error Goto 0
  1313. 	HelpText.innerHTML  = gvaHelpText.Item( "Step5" )
  1314. 	ButtonBack.disabled = False
  1315. 	ButtonNext.disabled = False
  1316. 	blnScheduleSelected = False
  1317. 	For Each objOption In SelectInterval.options
  1318. 		If objOption.selected Then
  1319. 			If Not objOption.value = "" Then
  1320. 				blnScheduleSelected = True
  1321. 			End If
  1322. 		End If
  1323. 	Next
  1324. 	If Not blnScheduleSelected Then
  1325. 		Step5_FillScheduleLists
  1326. 	End If
  1327. End Sub
  1328.  
  1329.  
  1330. Sub Step5_FillScheduleListHour( )
  1331. 	Dim i, objOption
  1332. 	SelectHour.innerHTML = ""
  1333. 	For i = 0 To 9
  1334. 		Set objOption = document.createElement( "OPTION" )
  1335. 		objOption.Text  = "0" & i
  1336. 		objOption.Value = i
  1337. 		SelectHour.Add( objOption )
  1338. 	Next
  1339. 	For i = 10 To 23
  1340. 		Set objOption = document.createElement( "OPTION" )
  1341. 		objOption.Text  = i
  1342. 		objOption.Value = i
  1343. 		SelectHour.Add( objOption )
  1344. 	Next
  1345. End Sub
  1346.  
  1347.  
  1348. Sub Step5_FillScheduleLists( )
  1349. 	Dim i, objOption
  1350.  
  1351. 	' Interval DropDown
  1352. 	SelectInterval.innerHTML = ""
  1353. 	Set objOption = document.createElement( "OPTION" )
  1354. 	objOption.Text  = "-- Interval --"
  1355. 	objOption.Value = ""
  1356. 	SelectInterval.Add( objOption )
  1357. 	Set objOption = document.createElement( "OPTION" )
  1358. 	objOption.Text  = "Every hour"
  1359. 	objOption.Value = "hour"
  1360. 	SelectInterval.Add( objOption )
  1361. 	Set objOption = document.createElement( "OPTION" )
  1362. 	objOption.Text  = "Daily"
  1363. 	objOption.Value = "day"
  1364. 	SelectInterval.Add( objOption )
  1365. 	Set objOption = document.createElement( "OPTION" )
  1366. 	objOption.Text  = "Weekly"
  1367. 	objOption.Value = "week"
  1368. 	SelectInterval.Add( objOption )
  1369. 	Set objOption = document.createElement( "OPTION" )
  1370. 	objOption.Text  = "Monthly"
  1371. 	objOption.Value = "month"
  1372. 	SelectInterval.Add( objOption )
  1373.  
  1374. 	' Day Of Month DropDown
  1375. 	SelectDayOfMonth.innerHTML = ""
  1376. 	For i = 1 To 9
  1377. 		Set objOption = document.createElement( "OPTION" )
  1378. 		objOption.Text  = "  " & i
  1379. 		objOption.Value = i
  1380. 		SelectDayOfMonth.Add( objOption )
  1381. 	Next
  1382. 	For i = 10 To 31
  1383. 		Set objOption = document.createElement( "OPTION" )
  1384. 		objOption.Text  = i
  1385. 		objOption.Value = i
  1386. 		SelectDayOfMonth.Add( objOption )
  1387. 	Next
  1388.  
  1389. 	' Day Of Week DropDown
  1390. 	SelectDayOfWeek.innerHTML = ""
  1391. 	Set objOption = document.createElement( "OPTION" )
  1392. 	objOption.Text  = "Monday"
  1393. 	objOption.Value = "1"
  1394. 	SelectDayOfWeek.Add( objOption )
  1395. 	Set objOption = document.createElement( "OPTION" )
  1396. 	objOption.Text  = "Tuesday"
  1397. 	objOption.Value = "2"
  1398. 	SelectDayOfWeek.Add( objOption )
  1399. 	Set objOption = document.createElement( "OPTION" )
  1400. 	objOption.Text  = "Wednesday"
  1401. 	objOption.Value = "3"
  1402. 	SelectDayOfWeek.Add( objOption )
  1403. 	Set objOption = document.createElement( "OPTION" )
  1404. 	objOption.Text  = "Thursday"
  1405. 	objOption.Value = "4"
  1406. 	SelectDayOfWeek.Add( objOption )
  1407. 	Set objOption = document.createElement( "OPTION" )
  1408. 	objOption.Text  = "Friday"
  1409. 	objOption.Value = "5"
  1410. 	SelectDayOfWeek.Add( objOption )
  1411. 	Set objOption = document.createElement( "OPTION" )
  1412. 	objOption.Text  = "Saturday"
  1413. 	objOption.Value = "6"
  1414. 	SelectDayOfWeek.Add( objOption )
  1415. 	Set objOption = document.createElement( "OPTION" )
  1416. 	objOption.Text  = "Sunday"
  1417. 	objOption.Value = "7"
  1418. 	SelectDayOfWeek.Add( objOption )
  1419.  
  1420. 	' Hour DropDown
  1421. 	Step5_FillScheduleListHour
  1422.  
  1423. 	' Minute DropDown
  1424. 	SelectMinute.innerHTML = ""
  1425. 	For i = 0 To 5 Step 5
  1426. 		Set objOption = document.createElement( "OPTION" )
  1427. 		objOption.Text  = "0" & i
  1428. 		objOption.Value = i
  1429. 		SelectMinute.Add( objOption )
  1430. 	Next
  1431. 	For i = 10 To 55 Step 5
  1432. 		Set objOption = document.createElement( "OPTION" )
  1433. 		objOption.Text  = i
  1434. 		objOption.Value = i
  1435. 		SelectMinute.Add( objOption )
  1436. 	Next
  1437.  
  1438. 	' Reminder DropDown
  1439. 	SelectReminderInterval.innerHTML = ""
  1440. 	Set objOption = document.createElement( "OPTION" )
  1441. 	objOption.Text  = "  1 day  "
  1442. 	objOption.Value = 1
  1443. 	SelectReminderInterval.Add( objOption )
  1444. 	For i = 2 To 9
  1445. 		Set objOption = document.createElement( "OPTION" )
  1446. 		objOption.Text     = "  " & i & " days"
  1447. 		objOption.Value    = i
  1448. 		objOption.selected = ( i = 7 )
  1449. 		SelectReminderInterval.Add( objOption )
  1450. 	Next
  1451. 	For i = 10 To 31
  1452. 		Set objOption = document.createElement( "OPTION" )
  1453. 		objOption.Text  = i & " days"
  1454. 		objOption.Value = i
  1455. 		SelectReminderInterval.Add( objOption )
  1456. 	Next
  1457. End Sub
  1458.  
  1459.  
  1460. Sub Step5_IntervalSelected( )
  1461. 	Dim objOption, strResult
  1462. 	For Each objOption In SelectInterval.options
  1463. 		If objOption.selected Then
  1464. 			strResult = objOption.value
  1465. 		End If
  1466. 	Next
  1467. 	Select Case strResult
  1468. 		Case "hour"
  1469. 			Set objOption = document.createElement( "OPTION" )
  1470. 			HourSpan.style.display                 = "inline"
  1471. 			SelectHour.innerHTML                   = ""
  1472. 			objOption.Text                         = "**"
  1473. 			objOption.Value                        = ""
  1474. 			SelectHour.Add( objOption )
  1475. 			SelectMinute.style.display             = "inline"
  1476. 			SelectDayOfWeek.style.display          = "none"
  1477. 			DaySpan.style.display                  = "none"
  1478. 			CheckboxRunImmediatelyIfMissed.checked = True
  1479. 		Case "day"
  1480. 			Step5_FillScheduleListHour
  1481. 			HourSpan.style.display                 = "inline"
  1482. 			SelectMinute.style.display             = "inline"
  1483. 			SelectDayOfWeek.style.display          = "none"
  1484. 			DaySpan.style.display                  = "none"
  1485. 			CheckboxRunImmediatelyIfMissed.checked = True
  1486. 		Case "week"
  1487. 			Step5_FillScheduleListHour
  1488. 			HourSpan.style.display                 = "inline"
  1489. 			SelectMinute.style.display             = "inline"
  1490. 			DaySpan.style.display                  = "none"
  1491. 			SelectDayOfWeek.style.display          = "inline"
  1492. 			CheckboxRunImmediatelyIfMissed.checked = True
  1493. 		Case "month"
  1494. 			Step5_FillScheduleListHour
  1495. 			HourSpan.style.display                 = "inline"
  1496. 			SelectMinute.style.display             = "inline"
  1497. 			DaySpan.style.display                  = "inline"
  1498. 			SelectDayOfWeek.style.display          = "none"
  1499. 			CheckboxRunImmediatelyIfMissed.checked = True
  1500. 		Case Else
  1501. 			Step5_FillScheduleListHour
  1502. 			HourSpan.style.display                 = "none"
  1503. 			SelectMinute.style.display             = "none"
  1504. 			SelectDayOfWeek.style.display          = "none"
  1505. 			DaySpan.style.display                  = "none"
  1506. 			CheckboxRunImmediatelyIfMissed.checked = False
  1507. 	End Select
  1508. End Sub
  1509.  
  1510.  
  1511. Sub Step5_ResetScheduleLists( )
  1512. 	Dim blnFirst, objOption
  1513. 	blnFirst = True
  1514. 	For Each objOption In SelectInterval.options
  1515. 		objOption.selected = blnFirst
  1516. 		blnFirst = False
  1517. 	Next
  1518. 	blnFirst = True
  1519. 	For Each objOption In SelectDayOfMonth.options
  1520. 		objOption.selected = blnFirst
  1521. 		blnFirst = False
  1522. 	Next
  1523. 	blnFirst = True
  1524. 	For Each objOption In SelectDayOfWeek.options
  1525. 		objOption.selected = blnFirst
  1526. 		blnFirst = False
  1527. 	Next
  1528. 	blnFirst = True
  1529. 	For Each objOption In SelectHour.options
  1530. 		objOption.selected = blnFirst
  1531. 		blnFirst = False
  1532. 	Next
  1533. 	blnFirst = True
  1534. 	For Each objOption In SelectMinute.options
  1535. 		objOption.selected = blnFirst
  1536. 		blnFirst = False
  1537. 	Next
  1538. End Sub
  1539.  
  1540.  
  1541. Sub Step5_ScheduleSelected( )
  1542. 	If CheckboxSchedule.checked Then
  1543. 		SelectInterval.style.display = "inline"
  1544. 		IntervalBlock.style.display  = "block"
  1545. 	Else
  1546. 		Step5_ResetScheduleLists
  1547. 		SelectInterval.style.display = "none"
  1548. 		IntervalBlock.style.display  = "none"
  1549. 	End If
  1550. End Sub
  1551.  
  1552.  
  1553. ' What If ...
  1554. Sub Step6( )
  1555. 	Dim blnScheduleSelected, objOption
  1556. 	TableStep1.style.display = "none"
  1557. 	TableStep2.style.display = "none"
  1558. 	TableStep3.style.display = "none"
  1559. 	TableStep4.style.display = "none"
  1560. 	TableStep5.style.display = "none"
  1561. 	TableStep6.style.display = "block"
  1562. 	HelpText.innerHTML  = gvaHelpText.Item( "Step6" )
  1563. 	ButtonBack.disabled = False
  1564. 	ButtonNext.disabled = False
  1565. 	blnScheduleSelected = False
  1566. 	For Each objOption In SelectInterval.options
  1567. 		If objOption.selected Then
  1568. 			If Not objOption.value = "" Then
  1569. 				blnScheduleSelected = True
  1570. 			End If
  1571. 		End If
  1572. 	Next
  1573. 	If CheckboxSchedule.checked And blnScheduleSelected Then
  1574. 		CheckboxReminder.checked               = False
  1575. 		CheckboxRunImmediatelyIfMissed.checked = True
  1576. 	Else
  1577. 		CheckboxReminder.checked               = True
  1578. 		CheckboxRunImmediatelyIfMissed.checked = False
  1579. 	End If
  1580. End Sub
  1581.  
  1582.  
  1583. Sub Step6_DisplayReminderInterval( )
  1584. 	If CheckboxReminder.checked Then
  1585. 		SelectReminderInterval.style.display = "inline"
  1586. 	Else
  1587. 		SelectReminderInterval.style.display = "none"
  1588. 	End If
  1589. End Sub
  1590.  
  1591.  
  1592. Sub StepBack( )
  1593. 	If TableStep6.style.display = "block" Then
  1594. 		Step5
  1595. 	ElseIf TableStep5.style.display = "block" Then
  1596. 		Step4
  1597. 	ElseIf TableStep4.style.display = "block" Then
  1598. 		Step3
  1599. 	ElseIf TableStep3.style.display = "block" Then
  1600. 		Step2
  1601. 	ElseIf TableStep2.style.display = "block" Then
  1602. 		Step1
  1603. 	End If
  1604. End Sub
  1605.  
  1606.  
  1607. Sub StepNext( )
  1608. 	If TableStep1.style.display = "block" Then
  1609. 		Step2
  1610. 	ElseIf TableStep2.style.display = "block" Then
  1611. 		Step3
  1612. 	ElseIf TableStep3.style.display = "block" Then
  1613. 		Step4
  1614. 	ElseIf TableStep4.style.display = "block" Then
  1615. 		Step5
  1616. 	ElseIf TableStep5.style.display = "block" Then
  1617. 		Step6
  1618. 	End If
  1619. End Sub
  1620.  
  1621.  
  1622. Function TextFromHTML( myURL )
  1623. 	Dim objHTTP
  1624. 	TextFromHTML = ""
  1625. 	On Error Resume Next
  1626. 	Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" )
  1627. 	objHTTP.Open "GET", myURL
  1628. 	objHTTP.Send
  1629. 	If Err Then gvbConnected = False
  1630. 	' Check if the result was valid, and if so return the result
  1631. 	If objHTTP.Status = 200 Then TextFromHTML = objHTTP.ResponseText
  1632. 	Set objHTTP = Nothing
  1633. 	On Error Goto 0
  1634. End Function
  1635.  
  1636.  
  1637. Sub TotalSize( )
  1638. 	If TableStep3.style.display = "block" Then
  1639. 		gviTotalSize = 0
  1640. 		On Error Resume Next
  1641. 		If CheckboxIncludeDocuments.checked Then gviTotalSize = gviTotalSize + SizeDocuments.innerHTML
  1642. 		If CheckboxIncludeMusic.checked     Then gviTotalSize = gviTotalSize + SizeMusic.innerHTML
  1643. 		If CheckboxIncludePictures.checked  Then gviTotalSize = gviTotalSize + SizePictures.innerHTML
  1644. 		If CheckboxIncludeVideos.checked    Then gviTotalSize = gviTotalSize + SizeVideos.innerHTML
  1645. 		If CheckboxIncludeCustom1.checked   Then gviTotalSize = gviTotalSize + SizeCustom1.innerHTML
  1646. 		If CheckboxIncludeCustom2.checked   Then gviTotalSize = gviTotalSize + SizeCustom2.innerHTML
  1647. 		If CheckboxIncludeCustom3.checked   Then gviTotalSize = gviTotalSize + SizeCustom3.innerHTML
  1648. 		If CheckboxIncludeCustom4.checked   Then gviTotalSize = gviTotalSize + SizeCustom4.innerHTML
  1649. 		On Error Goto 0
  1650. '		SizeTotal.innerHTML   = gviTotalSize
  1651. '		SizeTotalGB.innerHTML = GB( gviTotalSize, 0 )
  1652. '		MarkRedIfInsufficient "SizeTotal"
  1653. 		ButtonNext.disabled   = ( gviTotalSize = 0 )
  1654. 	End If
  1655. End Sub
  1656.  
  1657.  
  1658. Sub Window_OnLoad
  1659. 	document.title = CrBkupScr.ApplicationName & ",  Version " & CrBkupScr.Version & ", © 2015 Rob van der Woude"
  1660. 	gviWidth  = 800
  1661. 	gviHeight = 600
  1662. 	WindowSize
  1663. 	ListSpecialFolders
  1664. 	gvsTargetPath      = ""
  1665. 	gvbIsElevated      = IsElevated( )
  1666. 	gvbEditExistingJob = False
  1667. 	GenerateHelpText
  1668. 	Step1
  1669. 	window.setTimeout "CheckUpdate", 1000, "VBScript"
  1670. End Sub
  1671.  
  1672.  
  1673. Sub Window_OnUnload
  1674. 	On Error Resume Next
  1675. 	window.clearInterval gviInterval
  1676. 	Set gvaBackupJobs       = Nothing
  1677. 	Set gvaCloudStorage     = Nothing
  1678. 	Set gvaHelpText         = Nothing
  1679. 	Set gvaRemovableStorage = Nothing
  1680. 	Set gvaSpecialFolders   = Nothing
  1681. 	Set gvaVolumeSerials    = Nothing
  1682. 	On Error Goto 0
  1683. End Sub
  1684.  
  1685.  
  1686. Sub WindowSize( )
  1687. 	Dim posWidth, posHeight
  1688. 	On Error Resume Next
  1689. 	If gviWidth  > window.screen.width  Then gviWidth  = window.screen.width
  1690. 	If gviHeight > window.screen.height Then gviHeight = window.screen.height
  1691. 	posWidth  = ( window.screen.width  - gviWidth  ) / 2
  1692. 	posHeight = ( window.screen.height - gviHeight ) / 2
  1693. 	If posWidth  < 0 Then posWidth  = 0
  1694. 	If posHeight < 0 Then posHeight = 0
  1695. 	window.resizeTo gviWidth, gviHeight
  1696. 	window.moveTo posWidth, posHeight
  1697. 	NavigateButtons.style.left = CStr( ( gviWidth / 2 ) - 150 ) & "px"
  1698. 	On Error GoTo 0
  1699. End Sub
  1700.  
  1701.  
  1702. Function WriteMonitorScript( mySerial )
  1703. 	Dim strScript
  1704. 	strScript = "Option Explicit" & vbCrLf
  1705. 	strScript = strScript & "Dim colEvents, objEvent, objWMIService" & vbCrLf
  1706. 	strScript = strScript & "Set objWMIService = GetObject( ""winmgmts://./root/CIMV2"" )" & vbCrLf
  1707. 	strScript = strScript & "Set colEvents     = objWMIService.ExecNotificationQuery( ""SELECT * FROM __InstanceOperationEvent WITHIN 10 WHERE TargetInstance ISA 'Win32_LogicalDisk'"" )" & vbCrLf
  1708. 	strScript = strScript & "Do While True" & vbCrLf
  1709. 	strScript = strScript & vbTab & "Set objEvent = colEvents.NextEvent" & vbCrLf
  1710. 	strScript = strScript & vbTab & "If objEvent.TargetInstance.VolumeSerialNumber = mySerial Then" & vbCrLf
  1711. 	strScript = strScript & vbTab & vbTab & "Select Case objEvent.Path_.Class" & vbCrLf
  1712. 	strScript = strScript & vbTab & vbTab & vbTab & "Case ""__InstanceCreationEvent""" & vbCrLf
  1713. 	strScript = strScript & vbTab & vbTab & vbTab & vbTab & "Wscript.Echo ""Drive "" & objEvent.TargetInstance.DeviceId & "" has been added.""" & vbCrLf
  1714. 	strScript = strScript & vbTab & vbTab & vbTab & "Case ""__InstanceDeletionEvent""" & vbCrLf
  1715. 	strScript = strScript & vbTab & vbTab & vbTab & vbTab & "Wscript.Echo ""Drive "" & objEvent.TargetInstance.DeviceId & "" has been removed.""" & vbCrLf
  1716. 	strScript = strScript & vbTab & vbTab & "End Select" & vbCrLf
  1717. 	strScript = strScript & vbTab & "End If" & vbCrLf
  1718. 	strScript = strScript & "Loop" & vbCrLf
  1719. 	strScript = strScript & "Set colEvents     = Nothing" & vbCrLf
  1720. 	strScript = strScript & "Set objWMIService = Nothing" & vbCrLf
  1721. 	GetMonitorScript = strScript
  1722. End Function
  1. </script>
  2.  
  3. <body>
  4.  
  5. <div class="Center" style="width: 100%;">
  6.  
  7. <table id="TableStep1">
  8. <tr class="ReallyLarge">
  9. 	<td>&nbsp;</td>
  10. 	<th class="Column150">Step 1:</th>
  11. 	<td>&nbsp;</td>
  12. 	<th class="Column450">Keep it simple?</th>
  13. </tr>
  14. <tr>
  15. 	<td colspan="4">&nbsp;</td>
  16. </tr>
  17. <tr>
  18. 	<td><input type="radio" name="RadioBasicOrAdvanced" id="RadioBasic" onclick="Step1_DisplayBasicOrAdvanced" /></td>
  19. 	<th><label for="RadioBasic" id="LabelBasic">Basic installation</label></th>
  20. 	<td>&nbsp;</td>
  21. 	<th>&nbsp;</th>
  22. </tr>
  23. <tr>
  24. 	<td><input type="radio" name="RadioBasicOrAdvanced" id="RadioAdvanced" onclick="Step1_DisplayBasicOrAdvanced" /></td>
  25. 	<th><label for="RadioAdvanced" id="LabelAdvanced">Advanced installation</label></th>
  26. 	<td>&nbsp;</td>
  27. 	<th>&nbsp;</th>
  28. </tr>
  29. <tr>
  30. 	<td colspan="4">&nbsp;</td>
  31. </tr>
  32. <tr>
  33. 	<td>&nbsp;</td>
  34. 	<td colspan="3">&nbsp;</td>
  35. </tr>
  36. </table>
  37.  
  38.  
  39.  
  40.  
  41. <table id="TableStep2">
  42. <tr class="ReallyLarge">
  43. 	<td>&nbsp;</td>
  44. 	<th class="Column150">Step 2:</th>
  45. 	<td>&nbsp;</td>
  46. 	<th class="Column450">Backup Job</th>
  47. </tr>
  48. <tr>
  49. 	<td colspan="4">&nbsp;</td>
  50. </tr>
  51. <tr>
  52. 	<td><input type="radio" name="RadioBackupJob" id="RadioNewBackupJob" onclick="Step2_DisplayBackupJobs" /></td>
  53. 	<th><label for="RadioNewBackupJob" id="LabelNewBackupJob">New backup job</label></th>
  54. 	<td>&nbsp;</td>
  55. 	<th><input type="text" id="NameOfNewBackupJob" value="New Backup Job" onkeyup="Step2_CheckNameOfNewJob" /> &nbsp; <span id="NewBackupJobID"></span></th>
  56. </tr>
  57. <tr id="RowExistingJobs">
  58. 	<td><input type="radio" name="RadioBackupJob" id="RadioExistingBackupJob" onclick="Step2_DisplayBackupJobs" disabled="disabled" /></td>
  59. 	<th colspan="3"><label for="RadioExistingBackupJob" id="LabelExistingBackupJob">Existing backup job</label> &nbsp; <select id="ListOfExistingJobs" onchange="Step2_CheckNameOfNewJob"></select> &nbsp; <span id="ExistingBackupJobID"></span></th>
  60. </tr>
  61. </table>
  62.  
  63.  
  64.  
  65.  
  66. <table id="TableStep3">
  67. <tr class="ReallyLarge">
  68. 	<td>&nbsp;</td>
  69. 	<th class="Column150">Step 3:</th>
  70. 	<td>&nbsp;</td>
  71. 	<th class="Column450">What To Backup</th>
  72. 	<td class="Hidden"></td>
  73. </tr>
  74. <tr>
  75. 	<td colspan="4">&nbsp;</td>
  76. 	<dh class="Hidden"></td>
  77. </tr>
  78. <tr>
  79. 	<td><input type="Checkbox" id="CheckboxIncludeDocuments" checked="checked" onchange="TotalSize" onclick="TotalSize" /></td>
  80. 	<td colspan="3"><label for="CheckboxIncludeDocuments" id="LabelIncludeDocuments">My Documents</label></td>
  81. 	<td id="SizeDocuments" class="Hidden"></td>
  82. </tr>
  83. <tr>
  84. 	<td><input type="Checkbox" id="CheckboxIncludeMusic" checked="checked" onchange="TotalSize" onclick="TotalSize" /></td>
  85. 	<td colspan="3"><label for="CheckboxIncludeMusic" id="LabelIncludeMusic">My Music</label></td>
  86. 	<td id="SizeMusic" class="Hidden"></td>
  87. </tr>
  88. <tr>
  89. 	<td><input type="Checkbox" id="CheckboxIncludePictures" checked="checked" onchange="TotalSize" onclick="TotalSize" /></td>
  90. 	<td colspan="3"><label for="CheckboxIncludePictures" id="LabelIncludePictures">My Pictures</label></td>
  91. 	<td id="SizePictures" class="Hidden"></td>
  92. </tr>
  93. <tr>
  94. 	<td><input type="Checkbox" id="CheckboxIncludeVideos" checked="checked" onchange="TotalSize" onclick="TotalSize" /></td>
  95. 	<td colspan="3"><label for="CheckboxIncludeVideos" id="LabelIncludeVideos">My Videos</label></td>
  96. 	<td id="SizeVideos" class="Hidden"></td>
  97. </tr>
  98. <tr id="CustomRow1">
  99. 	<td><input type="Checkbox" id="CheckboxIncludeCustom1" disabled="disabled" onchange="TotalSize" onclick="TotalSize" onkeyup="TotalSize" /></td>
  100. 	<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>
  101. 	<td id="SizeCustom1" class="Hidden"></td>
  102. </tr>
  103. <tr id="CustomRow2" style="display: none; visibility: collapse;">
  104. 	<td><input type="Checkbox" id="CheckboxIncludeCustom2" disabled="disabled" onchange="TotalSize" onclick="TotalSize" onkeyup="TotalSize" /></td>
  105. 	<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>
  106. 	<td id="SizeCustom2" class="Hidden"></td>
  107. </tr>
  108. <tr id="CustomRow3" style="display: none; visibility: collapse;">
  109. 	<td><input type="Checkbox" id="CheckboxIncludeCustom3" disabled="disabled" onchange="TotalSize" onclick="TotalSize" onkeyup="TotalSize" /></td>
  110. 	<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>
  111. 	<td id="SizeCustom3" class="Hidden"></td>
  112. </tr>
  113. <tr id="CustomRow4" style="display: none; visibility: collapse;">
  114. 	<td><input type="Checkbox" id="CheckboxIncludeCustom4" disabled="disabled" onchange="TotalSize" onclick="TotalSize" onkeyup="TotalSize" /></td>
  115. 	<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>
  116. 	<td id="SizeCustom4" class="Hidden"></td>
  117. </tr>
  118. <tr>
  119. 	<td colspan="4">&nbsp;</td>
  120. 	<dh class="Hidden"></td>
  121. </tr>
  122. <tr id="RowStep3_ShowFullPath" style="display: none;">
  123. 	<td><input type="Checkbox" id="CheckboxShowFullPath" onclick="Step3_ShowFullPath" /></td>
  124. 	<td colspan="3"><label for="CheckboxShowFullPath" id="LabelShowFullPath">Show full paths instead of names</label></td>
  125. 	<td class="Hidden"></td>
  126. </tr>
  127. </table>
  128.  
  129.  
  130.  
  131. <table id="TableStep4">
  132. <tr class="ReallyLarge">
  133. 	<td>&nbsp;</td>
  134. 	<th class="Column150">Step 4:</th>
  135. 	<td>&nbsp;</td>
  136. 	<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>
  137. 	<td class="Hidden"></td>
  138. </tr>
  139. <tr>
  140. 	<td colspan="6">&nbsp;</td>
  141. 	<dh class="Hidden"></td>
  142. </tr>
  143. <tr id="RowBackupMediaCloud">
  144. 	<td><input type="radio" name="RadioButtonBackupMedia" id="RadioButtonBackupMediaCloud" value="cloud" onclick="Step4_DisplayMediaChoice" /></td>
  145. 	<td><label for="RadioButtonBackupMediaCloud" id="LabelBackupMediaCloud">Cloud storage</label></td>
  146. 	<td>&nbsp;</td>
  147. 	<td class="Colum200"><select id="DropdownCloudMedia" onchange="Step4_SetBackupPath"></select></td>
  148. 	<td>&nbsp;</td>
  149. 	<td class="Colum200" id="PathCloudStorage">&nbsp;</td>
  150. 	<td id="SpaceCloudStorage" class="Hidden"></td>
  151. </tr>
  152. <tr id="RowBackupMediaUSB">
  153. 	<td><input type="radio" name="RadioButtonBackupMedia" id="RadioButtonBackupMediaUSB" value="usb" onclick="Step4_DisplayMediaChoice" /></td>
  154. 	<td><input type="button" id="ButtonChooseSubfolder" value="Subfolder..." onclick="Step4_ChooseSubfolder" /></div><label for="RadioButtonBackupMediaUSB" id="LabelBackupMediaUSB">USB drive</label></td>
  155. 	<td>&nbsp;</td>
  156. 	<td class="Colum200"><select id="DropdownUSBMedia" onchange="Step4_SetBackupPath"></select></td>
  157. 	<td>&nbsp;</td>
  158. 	<td class="Colum200" id="PathUSBStorage">&nbsp;</td>
  159. 	<td id="SpaceUSBStorage" class="Hidden"></td>
  160. </tr>
  161. <tr id="RowBackupMediaHDD">
  162. 	<td><input type="radio" name="RadioButtonBackupMedia" id="RadioButtonBackupMediaHDD" value="hdd" onclick="Step4_DisplayMediaChoice" /></td>
  163. 	<td><label for="RadioButtonBackupMediaHDD" id="LabelBackupMediaHDD">Local harddisk</label></td>
  164. 	<td>&nbsp;</td>
  165. 	<td id="PathHDDStorage" colspan="3">&nbsp;</td>
  166. 	<td id="SpaceHDDStorage" class="Hidden"></td>
  167. </tr>
  168. <tr id="RowBackupMediaNetwork">
  169. 	<td><input type="radio" name="RadioButtonBackupMedia" id="RadioButtonBackupMediaNetwork" value="network" onclick="Step4_DisplayMediaChoice" /></td>
  170. 	<td><label for="RadioButtonBackupMediaNetwork" id="LabelBackupMediaNetwork">Network drive</label></td>
  171. 	<td>&nbsp;</td>
  172. 	<td id="PathNetworkStorage" colspan="3">&nbsp;</td>
  173. 	<td id="SpaceNetworkStorage" class="Hidden"></td>
  174. </tr>
  175. </table>
  176.  
  177.  
  178.  
  179. <table id="TableStep5">
  180. <tr class="ReallyLarge">
  181. 	<td>&nbsp;</td>
  182. 	<th class="Column150">Step 5:</th>
  183. 	<td>&nbsp;</td>
  184. 	<th class="Column450">How And When To Backup</th>
  185. </tr>
  186. <tr>
  187. 	<td colspan="4">&nbsp;</td>
  188. </tr>
  189. <tr>
  190. 	<td><input type="Checkbox" id="CheckboxManual" checked="checked" /></td>
  191. 	<td><label for="CheckboxManual" id="LabelManual1">Manually (create a shortcut)</label></td>
  192. 	<td>&nbsp;</td>
  193. 	<td><label for="CheckboxManual" id="LabelManual2">When I doubleclick the shortcut</label></td>
  194. </tr>
  195. <tr>
  196. 	<td><input type="Checkbox" id="CheckboxAtLogon" /></td>
  197. 	<td><label for="CheckboxAtLogon" id="LabelAtLogon1">At logon</label></td>
  198. 	<td>&nbsp;</td>
  199. 	<td><label for="CheckboxAtLogon" id="LabelAtLogon2">When I log in</label></td>
  200. </tr>
  201. <tr>
  202. 	<td><input type="Checkbox" id="CheckboxAtLogoff" /></td>
  203. 	<td><label for="CheckboxAtLogoff" id="LabelAtLogoff1">At logoff</label></td>
  204. 	<td>&nbsp;</td>
  205. 	<td><label for="CheckboxAtLogoff" id="LabelAtLogoff2">When I log out</label></td>
  206. </tr>
  207. <tr>
  208. 	<td><input type="Checkbox" id="CheckboxSchedule" onclick="Step5_ScheduleSelected" onkeyup="Step5_ScheduleSelected" /></td>
  209. 	<td><label for="CheckboxSchedule" id="LabelSchedule">Scheduled</label></td>
  210. 	<td>&nbsp;</td>
  211. 	<td><div id="IntervalBlock"><select id="SelectInterval" style="display: none;" onchange="Step5_IntervalSelected"></select>
  212. 		&nbsp;
  213. 		<span id="DaySpan" style="display: none;">Day:&nbsp;<select id="SelectDayOfMonth"></select></span>
  214. 		<select id="SelectDayOfWeek" style="display: none;"></select>
  215. 		&nbsp;
  216. 		<span id="HourSpan" style="display: none;">Time:&nbsp;<select id="SelectHour"></select>:</span>
  217. 		<select id="SelectMinute" style="display: none;"></select></div></td>
  218. </tr>
  219. <tr id="RowOnDiskInsert">
  220. 	<td><input type="Checkbox" id="CheckboxOnDiskInsert" /></td>
  221. 	<td><label for="CheckboxOnDiskInsert" id="LabelOnDiskInsert1">Automatically</label></td>
  222. 	<td>&nbsp;</td>
  223. 	<td><label for="CheckboxOnDiskInsert" id="LabelOnDiskInsert2">When the selected backup medium is inserted</label></td>
  224. </tr>
  225. </table>
  226.  
  227.  
  228.  
  229.  
  230. <table id="TableStep6">
  231. <tr class="ReallyLarge">
  232. 	<td>&nbsp;</td>
  233. 	<th class="Column150">Step 6:</th>
  234. 	<td>&nbsp;</td>
  235. 	<th class="Column450">What if I missed a backup?</th>
  236. </tr>
  237. <tr>
  238. 	<td colspan="4">&nbsp;</td>
  239. </tr>
  240. <tr id="RowReminderManual">
  241. 	<td><input type="Checkbox" id="CheckboxReminder" checked="checked" onclick="Step6_DisplayReminderInterval" /></td>
  242. 	<td colspan="3"><select id="SelectReminderInterval"></select><label for="CheckboxReminder" id="LabelReminder">Remind me after...</label></td>
  243. </tr>
  244. <tr id="RowRunImmediatelyIfMissed">
  245. 	<td><input type="Checkbox" id="CheckboxRunImmediatelyIfMissed" /></td>
  246. 	<td colspan="3"><label for="CheckboxRunImmediatelyIfMissed" id="LabelRunImmediatelyIfMissed">Run as soon as possible after missed schedule</label></td>
  247. </tr>
  248. </table>
  249.  
  250.  
  251.  
  252.  
  253. <div id="Navigate">
  254.  
  255. <p id="HelpText"></p>
  256.  
  257. <p id="NavigateButtons"><input type="button" id="ButtonBack" value="<<  Back" onclick="StepBack" /> &nbsp; &nbsp; <input type="button" id="ButtonNext" value="Next  >>" onclick="StepNext" /></p>
  258.  
  259. </div>
  260.  
  261. </div>
  262.  
  263. </body>
  264. </html>

page last modified: 2024-02-26; loaded in 0.1216 seconds