automate program that change folder icon if empty (red) or not (green)
Posted: 19 May 2017, 05:48
Hello ! I'll kill me soon if i cannot end this script so i'm finally asking some help about some tips.
Sorry if my english is bad !!!!
Days and nights i'm trying to find a solution !!!
We are working in a huge tree structure with thousand of empty folder to start.....
Then we fill them little by little for month.
So it can be hard to find some file when people are working bad or just when we don't know if the file already exist or not.
What i'm looking for : Creating a script that check a master folder and all of his sub folder and turn all empty folder into red and not empty folder into normal state, every minute or when the user press a key to refresh color, i still don't know.
The idea : all folder start in red, then the color of the folder and his parent folder change when a user put a file into it
My first script :
But it's still have bug because sometime it doesn't work, i don't know how to just rename a folder so i have to cut/past the folder and rename the new folder so it fail sometime.....and i can even loose file into the new folder or having a fail renaming..... I cannot take risk in a very huge project with thousand of file and sometime more than 1To file ++++. I don't like the idea of cut/past, and if someone is working in a file, we cannot cut/past etc.....
The 2nd script
My loop is cheking folder size, if size = 0 it change the folder color, if > 0 i turn it back to normal state.
So now it's working on all sub folder but not parent folder ! because the desktop.ini file have a size and the folder isn't considered as empty after the creation of the desktop.ini !!!
So what i'm looking for is a way to ignore desktop.ini in the loop !! I have no idea how yo change folder color not using desktop.ini....
The loop is working fine, the icon color change too, but not together ....
So my solution would be :
- Ignore desktop.ini file size in the loop ??
- Instead of checking folder size to change color, check number of file into the folder + sub folder excluding .ini extension file ?????
and change color if number of file = 0 etc....
- have you an other idea ????!!
Thk you if you can find a solution for me ! and if you can check if my script is well done ( bug, optimization etc...) i'm not a ahk scripter so it's totally new for me, and check if its secure and safe to use.
and if you want you can help me to instead of choosing the folder, make it always working and we just have to press something like F12 key to execute the script once. I don't think it's a good idea to make it running every 30s or something like this....
Remember that it's to use in a very big tree structure, and it should be fast and safe.
I've tryied a lot of software to do it but all of the software isn't automatized...always have to change folder icon by hand one by one.....
and if you copy/past the folder it loose the color....
And only folder marker that isn't free allow you to work with folder + sub folder color change. it's the best i've find but still not that good/fast and 30$/computer is hard when we have more than 10 computer here.......
here you can copy/past execute the script and recover your folder color
THK You for saving my life !!!!!!!!! I hope this script can help several person too !! it's really useful
Sorry if my english is bad !!!!
Days and nights i'm trying to find a solution !!!
We are working in a huge tree structure with thousand of empty folder to start.....
Then we fill them little by little for month.
So it can be hard to find some file when people are working bad or just when we don't know if the file already exist or not.
What i'm looking for : Creating a script that check a master folder and all of his sub folder and turn all empty folder into red and not empty folder into normal state, every minute or when the user press a key to refresh color, i still don't know.
The idea : all folder start in red, then the color of the folder and his parent folder change when a user put a file into it
My first script :
Spoiler
This work well but change the name of the folder instead of his color. It was the first idea, but icon color is a much more better idea.But it's still have bug because sometime it doesn't work, i don't know how to just rename a folder so i have to cut/past the folder and rename the new folder so it fail sometime.....and i can even loose file into the new folder or having a fail renaming..... I cannot take risk in a very huge project with thousand of file and sometime more than 1To file ++++. I don't like the idea of cut/past, and if someone is working in a file, we cannot cut/past etc.....
The 2nd script
Spoiler
Now it's the same but with icon color instead of rename. The loop i'm using to check all folder and subfolder is working very well with renaming but not with color folder because of the desktop.ici file generated.......My loop is cheking folder size, if size = 0 it change the folder color, if > 0 i turn it back to normal state.
So now it's working on all sub folder but not parent folder ! because the desktop.ini file have a size and the folder isn't considered as empty after the creation of the desktop.ini !!!
So what i'm looking for is a way to ignore desktop.ini in the loop !! I have no idea how yo change folder color not using desktop.ini....
The loop is working fine, the icon color change too, but not together ....
So my solution would be :
- Ignore desktop.ini file size in the loop ??
- Instead of checking folder size to change color, check number of file into the folder + sub folder excluding .ini extension file ?????
and change color if number of file = 0 etc....
- have you an other idea ????!!
Thk you if you can find a solution for me ! and if you can check if my script is well done ( bug, optimization etc...) i'm not a ahk scripter so it's totally new for me, and check if its secure and safe to use.
and if you want you can help me to instead of choosing the folder, make it always working and we just have to press something like F12 key to execute the script once. I don't think it's a good idea to make it running every 30s or something like this....
Remember that it's to use in a very big tree structure, and it should be fast and safe.
I've tryied a lot of software to do it but all of the software isn't automatized...always have to change folder icon by hand one by one.....
and if you copy/past the folder it loose the color....
And only folder marker that isn't free allow you to work with folder + sub folder color change. it's the best i've find but still not that good/fast and 30$/computer is hard when we have more than 10 computer here.......
here you can copy/past execute the script and recover your folder color
THK You for saving my life !!!!!!!!! I hope this script can help several person too !! it's really useful