To do this in an easy way we need 10 icon files. After gathering up all ten icons rename them to core(0-9).ico like:
![]()
Now, create a folder named “icons” on the top of the Pen Drive directory (root) and copy the icons on it.
First make sure that file extensions are showed up and to do this Click on Tools > Folder Options > View and uncheck the box saying ” Hide extensions for known files“.
Now Right Click on the Pen Drive’s folder and choose new>Text Document and name it icon.bat . Click OK for confirmation file extension change.
Open the file with notepad and copy the following lines:
@echo OFF
set num=%random:~-1%
ATTRIB -r -h Autorun.inf
del Autorun.inf /f
echo [autorun] > Autorun.inf
echo icon=icons\core%num%.ico >> autorun.inf
echo open=icon.bat >> Autorun.inf
echo shellexecute=icon.bat >> Autorun.inf
echo shell\auto\command=icon.bat >> Autorun.inf
echo shell\open\command=icon.bat >> Autorun.inf
ATTRIB +r +h Autorun.inf
explorer.exe \
exit
Double Click on the icon.bat file and a hidden autorun.inf file will be created and it will contain something like:

But if you double click on the file icon.bat again it may look like:

As the Autorun.inf file responsible for the icon replacement you should notice the only change in the pictures that core5.ico is changed to core4.ico. So as many times the icon.bat file is accessed the icon name will change giving you a changing icon.

When you Plug In your Pen Drive, the icon.bat file will be accessed if autorun is enabled or if you choose Auto or Open options on the right click menu of the drive it will also open the icon.bat file, resulting the change in icon name assigned with the Autorun.inf file.
Hope it helps and dont forget to open the icon.bat file after saving it otherwise it will not create the Autorun.inf file
You can download a package in here.
awesome
Powered by Zoundry Raven
Filed under: Uncategorized | Tagged: Changeble Pen Drive Icon, Changing Pen Drive Icon, Random Pen Drive Icon, USB Pen Drive
how can one put a file(of any extension) in autorun.inf file
plz give me its solution.
HEY thanks for the tip!
But I was just wandering ummm….. what if I have more than 10 icons? what if I have 13 icons? will it still work?
And kindly explain the coding!
I am new to progamming!
Heh heh
thanks again!
Thancks you for showing tis. I am very existing and i am very please it.
it nice and informative
ok so long story short this be my autorun file:
[autorun]
Label= MY KEY!?
Action= SERIOUSLY A F*&*&* KEY!?
shell= WTF!?!
icon=JJ.ICO
open=lost.bat
shellexecute=lost.bat
shell\auto\command=lost.bat
shell\open\command=lost.bat
and i want it to have the random icon thing so how would i do it?