Thursday, May 30, 2013

About autorun file on removable medias

Whenever one insert any media like CD in his computer, it senses the new CD and looks for a file in root of CD called autorun.inf. This is the first file gets excuted on insertion of any CD. It contains the command to be run for autoplay, and the icon to be shown while veiwing on file explorer.

It's a plain text file, which can be edited using any text editor, like notepad. It basically contains key=value pair for commands. Sample of autorun.inf file:

[autorun]
open=setup.exe
icon=setup.ico

some other commands which can be written on autorun.inf file
shellexecute=[filepath\]filename
UseAutoPlay=1

This setup.exe and setup.ico should be on root directory of CD.
To test the autorun created by you, refer to Disabling autorun autoplay, to enable autorun for any particular type of drive, for example you can enable for FIXED drives and then test on your C/D/E drives.

For more information on creation of autorun file please refer to wiki page.

Using android adb shell

To excute shell command using your pc, connect device to your system, and give command as "adb devices", to check whether device is connected properly or not.
Now you can excute "adb shell" command to access shell of your device.

All available shell commands for Android phones can be checked using below command:
adb shell ls /system/bin

rm : It's similar to rm command of Unix to remove files and directories.
rmdir : rmdir(rd) command removes an empty directoryon Unix, windows, DOS systems