CloudD901 Posted December 7, 2010 Share Posted December 7, 2010 I have a small issue with a progress bar. The script I am using it on is to clean temporary files remotely in my workplace. My old script used folder recursion to find every file in the temp folders and run a 'FileDelete' command on each file. Using a progress bar for this situation was simple; make an array containing all folders and use 'For Next' and add a progress bar. My new script attempts to run a 'DirRemove' on the folder first. This seems to have cut down on half the time, but I am unable to modify the progress bar while this command is running. It is possible for a pc to have well over 10k temp files and removing the folder may take 5-10 min. During this time, I have no way of editing the progress bar. 1) My thoughts were to use 'DirGetSize' and 'AdlibRegister' to get a file count every 10-30 seconds and update the progress bar. But 'AdlibRegister' will not call the function while 'DirRemove' is working. 2) My second thought was to use 'DirGetSize' in a separate script to continuously check the file count and in return update the progress bar. But I can't seem to get the second script to modify the progress bar on the first script. 'GUICtrlSetData' won't work from one script to another and I can't find a function that will. 3)? Any thoughts? Link to comment Share on other sites More sharing options...
jiglei Posted December 7, 2010 Share Posted December 7, 2010 You can make the second script have the GUI Window with the progress, I guess. It's just an ideia to make it simple. Link to comment Share on other sites More sharing options...
CloudD901 Posted December 7, 2010 Author Share Posted December 7, 2010 (edited) I thought about that, but it might look a little strange. The first script uses the progress bar for other functions very often so keeping it in that GUI is a must. If I could somehow use the second script to hide that progress bar and create a new one over it temporarily, that would be good, but i don't know how to add controls to another GUI. A transparent window over the top might work as well, but then you loose the ability to move the window and see two GUI's on the task bar. Thanks though. I have a few scripts that are anything but simple. It's these kinds of things that keep me going. Edited December 7, 2010 by cloudd901 Link to comment Share on other sites More sharing options...
jiglei Posted December 7, 2010 Share Posted December 7, 2010 Well then, you coulid instead use the second script to delete the files, and the first one to update the progress. You can transfer the filenames or folder using INI saving, or even by running the program with commands, telling which files to delete. To your ideia of running a transparent window over the other one, i have a similiar post on to do something like that, also about a progress bar, on a UDF im building. If I had the answer to that question that could be useful to you :| Link to comment Share on other sites More sharing options...
CloudD901 Posted December 7, 2010 Author Share Posted December 7, 2010 Well then, you coulid instead use the second script to delete the files, and the first one to update the progress. You can transfer the filenames or folder using INI saving, or even by running the program with commands, telling which files to delete. LOL that's awesome. I think my head's been in my script too long. I usually call exe's with command line parameters. ($cmdline[] is less mess than working with extra files.) Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now