Hi all
I have 3 Dos commands
Then I have a loop that runs X amount of times, based on the amount of contend in an array
In the loop I have another 14 Dos commands, with a progress bar updating between EACH dos command.
The Loop ends and I have another 3 Dos commands.
Doscommand freezes the UI untill the script is done. Any progress bars dont update during the freeze
HiddenDosCommand does the same thing. However if I use the switch
HiddenDosCommand ("bla bla bla") donotwait:true
..then the commands run nice and fast and the UI doesnt't freeze, BUT I CAN NOT do this, since each Dos command is dependant on the previous Dos command to complete, before it can continue, otherwise I get errors.
For example I can't create a folder with one command...
then copy files into it
then rename it
then copy more files
then delete the folder
...if the "create folder" part wasn't complete. This is a simplification in my explanation, as the actual commands are complex and take between 1 and 4 seconds to complete each
For the same reason ShellLaunch can't work, because each previous command should complete beforew the next one starts.
So I thought the answer was .NET
I have a function:
fn HiddenDotNetCommand Command= ( Process = DotNetObject "System.Diagnostics.Process" Process.StartInfo.FileName = "cmd.exe" Process.StartInfo.Arguments = "/C " + Command Process.StartInfo.UseShellExecute = false Process.StartInfo.CreateNoWindow = true Process.Start() Process.WaitForExit() --Process.StartInfo.UseShellExecute = false --Process.StartInfo.RedirectStandardOutput = false --string output = Process.StandardOutput.ReadToEnd() )
The commented out bits is other things I tried
Then I call the Dos command with something like:
HiddenDotNetCommand ("bla bla bla")
Everything works beautifully if the array only has 1 object and the loop runs just once. If however there are 3 or 4 or more objects in the array, and then the loop runs 3 or 4 or more times, I AGAIN get the stuck UI until the script completes. It works fine, except the UI freezes.
Thoughts?
Solved! Go to Solution.
Solved by Morne3D. Go to Solution.