Joined
·
1,124 Posts
I would love to learn how to do things like this. I have only worked VB myself (somewhat).
I might make some pseudo code to explain my idea. give me about 10 minutes.Originally Posted by FiX;12867556
well, theres nothing i can do about the steamapps folder as its only 1 archive. but i can get all the common folders on different threads running concurrently
Public Class Form1
Public Shared backupDir() As String
Public Shared i As Integer = 0
Public Sub btnBackup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBackup.Click
Dim sDir As Integer = tbxSteamDir.text
Dim bDir As Integer = tbxBackupDir.text
Dim numThreads As Integer = tbxNumThreads.text
' add steam apps to array
backupDir(i) = Application.StartupPath & ".7za.exe a -t7z " & bDir & "\steamapps.7z " & sDir & "\steamapps\* -mx9 -xr!common"
i++
' add individual common folders to array
For Each cmnFolder As String In IO.Directory.GetDirectories(sDir & "\steamapps\common")
' Get folder name
Dim folder As String = ""
For c = Len(cmnFolder) To 1 Step -1
If Mid(cmnFolder, c, 1) = "\" Then
Exit For
Else
folder = Mid(cmnFolder, c, 1) & folder
End If
Next c
' Add to array
backupDir(i) = Application.StartupPath & ".7za.exe a -t7z " & cmnFolder & "\common\" & folder & ".7z " & cmnFolder & " -mx9"
i++
Next
'Start Threads
Dim l As Integer
While l <= numThreads
' start threads in here
End While
End Sub
Public Class runThread
' do what you normally do in each thread but use the last index of backupDir(i) as the command deleting it as it gets used.
End Class
End Class