REM Example, how to look for CDROM-drive. Must have a file called WIN51 in its root. for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\WIN51 set CDROM=%%i: echo Found CD-Rom as drive %CDROM% thats only searching for a file on a drive, just tell it a different file, or give it a different path to search instead of each drive letter, u could have it search folders or anything type FOR /? in command prompt