@@ -32,7 +32,7 @@ Public Class Compact
3232 Dim fileCountProgress As Int64
3333 Dim fileCountOutputCompressed As Int64
3434 Dim QdirCountProgress As Int64
35-
35+ Dim localisationAdjustment = "[Threading.Thread]::CurrentThread.CurrentUICulture = 'en'; "
3636
3737 Private Sub MyProcess_ErrorDataReceived _
3838 ( ByVal sender As Object , ByVal e As System.Diagnostics.DataReceivedEventArgs) _
@@ -53,7 +53,7 @@ Public Class Compact
5353
5454 Try
5555
56- If e.Data.Contains( "total bytes of data are stored in" ) Then 'Gets the output line that contains both the pre- and post-compression folder sizes
56+ If e.Data.Contains( "total bytes of data are stored in" ) Then 'Gets the output line that contains both the pre- and post-compression folder sizes
5757 byteComparisonRaw = e.Data
5858 End If
5959
@@ -344,7 +344,7 @@ Public Class Compact
344344 MyProcess = New Process
345345
346346 With MyProcess.StartInfo
347- .FileName = "CMD .exe"
347+ .FileName = "powershell .exe"
348348 .Arguments = ""
349349 .UseShellExecute = False
350350 .CreateNoWindow = True
@@ -361,7 +361,7 @@ Public Class Compact
361361
362362 Try
363363
364- MyProcess.StandardInput.WriteLine( "cd /d " + workingDir)
364+ MyProcess.StandardInput.WriteLine( "cd " + workingDir)
365365 MyProcess.StandardInput.Flush()
366366
367367 MyProcess.StandardInput.WriteLine( "" ) 'Required for the embedded console to show the next line in the buffer after the 'cd' command. No idea why
@@ -599,7 +599,7 @@ Public Class Compact
599599 compactArgs = compactArgs + " /EXE:LZX"
600600 End If
601601
602- MyProcess.StandardInput.WriteLine(compactArgs)
602+ MyProcess.StandardInput.WriteLine(localisationAdjustment & compactArgs)
603603 MyProcess.StandardInput.Flush()
604604
605605 isQueryCalledByCompact = 1
@@ -616,13 +616,13 @@ Public Class Compact
616616 compactArgs = compactArgs + " /A"
617617 End If
618618
619- MyProcess.StandardInput.WriteLine(compactArgs)
619+ MyProcess.StandardInput.WriteLine(localisationAdjustment & compactArgs)
620620 MyProcess.StandardInput.Flush()
621621
622622 ElseIf desiredfunction = "query" Then
623623 compactArgs = "compact /S /Q /EXE"
624624
625- MyProcess.StandardInput.WriteLine(compactArgs)
625+ MyProcess.StandardInput.WriteLine(localisationAdjustment & compactArgs)
626626 MyProcess.StandardInput.Flush()
627627
628628 End If
0 commit comments