emendelson Posted November 23, 2024 Posted November 23, 2024 This should be obvious, but I can't find the answer anywhere. I have a For...Next routine that counts from ASCII 65 to 90 to find free drive letters, starting with A: and ending with Z: Is there a way to make it count down from 90 to 65, so it will start with Z:?? This is the code I use: For $x = 65 To 90 If DriveStatus(Chr($x) & ':\') = 'INVALID' Then $firstFree = (Chr($x) & ':') ExitLoop EndIf Next Thanks for any advice. Again, I think the answer should be obvious, but it isn't obvious to me.
Nine Posted November 23, 2024 Posted November 23, 2024 If DriveStatus(Chr($x) & ':\') <> 'INVALID' Then “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Solution Andreik Posted November 23, 2024 Solution Posted November 23, 2024 For $x = 90 To 65 Step -1 ... Next
emendelson Posted November 23, 2024 Author Posted November 23, 2024 31 minutes ago, Nine said: If DriveStatus(Chr($x) & ':\') <> 'INVALID' Then What I'm looking for is a drive letter that is NOT currently in use, so that I can assign it as a drive letter in a DOS emulator (DOSBox or vDos), which is why I needed = INVALID.
emendelson Posted November 23, 2024 Author Posted November 23, 2024 17 minutes ago, Andreik said: For $x = 90 To 65 Step -1 ... Next Thank you! I guessed that the answer was simple, but I simply didn't know what it was. Perfect!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now