Reputation: 11
In this code, if the folder name has a space character, the zipper will not be done. How to ignore the space character in str. But it's not working.
Dim pinfo As New ProcessStartInfo()
pinfo.FileName = "C:\Program Files\WinRAR\WinRAR.exe"
Dim s As String = txtCode.Text
Dim dir As New DirectoryInfo("D:\نهایی\" & s)
For Each dirItem As DirectoryInfo In dir.GetDirectories
Dim str As String = dirItem.ToString()
Dim dis As String = "D:\نهایی\" & s & "\" & str & ".rar"
Dim src As String = " D:\نهایی\" & s & "\" & str
pinfo.Arguments = "a -cpF " & dis & src
Dim p As Process = Process.Start(pinfo)
p.WaitForExit()
Next
Upvotes: 1
Views: 53