
next available drive letter
I thought I had a moment of glory - finding a Michael Harris oversight - but it
was a hardware glitch on my machine...
As an addendum, note that if you are drive-short and on a pure NT/2000/XP LAN,
you can start your drive iteration with "a". Any of those operating systems
will quite happily accept "A:" and "B:" as mapped drives.
Quote:
> Is there a script command that will map the next available drive
> letter as the below net use command will do?
> net use * \\computer\folder
No but you can write your own...
function freedrive()
dim fso, i
set fso = createobject("scripting.filesystemobject")
for i = asc("d") to asc("z")
if not fso.driveexists(chr(i)) then
freedrive = ucase(chr(i))
exit function
end if
next
end function
msgbox freedrive()
--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--