next available drive letter 
Author Message
 next available drive letter

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

Thanks

Jerry



Sat, 02 Oct 2004 05:13:07 GMT  
 next available drive letter

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
--



Sat, 02 Oct 2004 05:34:45 GMT  
 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
--



Sat, 02 Oct 2004 05:57:26 GMT  
 next available drive letter
Thanks.

You guys are just the best for all of your knowledge and help.



Quote:
> 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.



> > 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
> --



Sat, 02 Oct 2004 06:31:10 GMT  
 next available drive letter
Thanks, oh wait, I didn't help on this one...dang...too slow.

Mythran



Sat, 02 Oct 2004 23:22:39 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. logon script to check the next available drive letter (The code is a bit long)

2. Finding next available drive letter

3. next available drive

4. first available drive letter?

5. Drive letter driving me crazy!

6. Retrieving drive letter for user's cd-rom drive

7. Determining drive letter assigned to floppy drive?

8. local drive letter <> drive share name

9. Next free letter for network connection

10. letter initmatrix, Agfa 3400 PS, functions available

11. BBFig for NeXT -- %%BoundingBox utility available via FTP

12. Adobe Fonts Available 5/91 (apparently) for the NeXT

 

 
Powered by phpBB® Forum Software