1.

Solve : Explore unknown drive?

Answer» HI!

I'd like to have a batch for my MultiSlotCardReader. It's suppose to check drive K: L: M: and N: for directorys AND/OR files. If there are any files present then it should EXPLORE the drive.

Can't get it working with wildcard-files and directorys, only specified filetypes.

Any smart ideas?

Thanks!It's for Windows XP btw Try this
Code: [Select]@echo off
dir K:\ *.* /s >> scan.txt
dir L:\ *.* /s >> scan.txt
dir M:\ *.* /s >> scan.txt
dir N:\ *.* /s >> scan.txt
echo Done!
pause> nulUhm YEAH, that code prints the content of the drives to scan.txt.

I want it to Explore the drives if any files exist.

Code: [Select]@echo off
IF NOT EXIST C:\test\1\*.txt GOTO two (
) ELSE (
explorer C:\test\1.
:two
IF NOT EXIST C:\test\2\*.txt GOTO three (
) ELSE (
explorer C:\test\2.
:three
IF NOT EXIST C:\test\3\*.txt GOTO four (
) ELSE (
explorer C:\test\3.
:four
IF NOT EXIST C:\test\4\*.txt GOTO End
) ELSE (
explorer C:\test\4.
:END

That code almost does it, but I don't want to specify the filetype. If I SET ..
Code: [Select]IF NOT EXIST C:\test\1\*.*, GOTO two (
) ELSE (
explorer C:\test\1.
..all drives is opened.So you want to be able to explore them within the shell. OK you could cheak to see if the drive or path is there and if it is change directiory (cd)Hmm okay, any EXAMPLES on that? I think this will do what you want:
Code: [Select]@echo off
for %%a in (K L M N) do dir %%a: >NUL 2>&1&if not errorlevel 1 start explorer /root,%%a:\Thank you! I'll try that out tomorrow Ahh, that works GREAT! Thank you very much Gary!No problem.


Discussion

No Comment Found