I have a folder on my desktop and 12 different icons. I want to create a scheduled task with Task Scheduler that runs as long as my PC is on and changes the icon of the fold
I was able to make a working model here:
Set DriveLetter=C
Set Pathing=test
Set IconPath=users\username\desktop\icon.ico
attrib -s -h -r %DriveLetter%:\%Pathing%\desktop.ini
echo [.ShellClassInfo] >%DriveLetter%:\%Pathing%\desktop.ini
echo IconFile=%DriveLetter%:\%IconPath%>>%DriveLetter%:\%Pathing%\desktop.ini
echo IconIndex=0 >>%DriveLetter%:\%Pathing%\desktop.ini
attrib +s +h +r %DriveLetter%:%Pathing%\desktop.ini
attrib +s +r %DriveLetter%:\%Pathing%
pause
Please note the following:
This doesn't require the need for "DriveLetter" I just like adding that to my scripts (Though having the drive letter specified is required, you just don't need the extra option it can be merged in with the path[Pathing] Option)
DriveLetter= The drive you want it on
Pathing= the path to the folder in question you wish to change
Iconpath= the full path to the icon's location
The result is I have a folder located @ E:\test\ that has the icon in question
you should be able to run that code and get output by only editing the top 3 lines, or you could write it in manually.
You can use below script that I found it here.
If [%1] == [] goto :eof
ECHO [.ShellClassInfo] >%1\desktop.in
ECHO IconResource=C:\icon.ico,0 >>%1\desktop.in
move %1\desktop.in %1\desktop.ini
attrib +S +H %1\desktop.ini
attrib +R %1