Next Free Drive Letter

(imported topic written by Steve91)


I’ve tried figuring this out and not had much joy.

I’d like to retrieve the next free drive letter with relevance language

I can do this in VB but I want to pass the drive letter as a parameter later on in the action script so would like to use relevance language

Can anyone advise on this?



(imported comment written by Lee Wei)

Hi Steve,

Try this and let me know if it works. My laptop has drives C and D.

q: hexadecimal string (((it + 1) as string) of maximum of ((firsts 1 of string values of selects “name from win32_logicaldisk” of wmi) as hexadecimal as integer))

A: E

(imported comment written by Steve91)

Hi Lee

Thanks for looking at this.

It works, but not completely.

If for instance I have my S: drive mappoed but F: - R: are free. When I run the relevance it tells me the next free drive is T: when I’d expect to see F:

Also, if I map my Y: drive and run the relevance is returns the character ’ instead of a drive letter (this is with Z: not mapped)



(imported comment written by pmullins91)

This is ugly but it seems to work for me:

q: names of drives as string A: C: A: D: A: H: T: 0.045 ms I: plural string   q: preceding text of first 
"#" of concatenation 
"#" of elements of (set of (
"Z:") - set of (names of drives as string)) A: E: T: 0.218 ms I: singular substring

(imported comment written by Lee Wei)

I like it!

The logic makes sense, and the results are perfect.

(imported comment written by Steve91)

Works good for me too.


Although only on version 7