Issue with code?
#8
If one is talking Windows, there's a ton of simple ways you can get drive info:

Code: (Select All)
Screen _NewImage(1024, 720, 32)

Shell _Hide "cmd /c wmic logicaldisk get name >temp.txt"
Open "temp.txt" For Input As #1
Do Until EOF(1)
    Line Input #1, file$
    Print file$
Loop
Close

Sleep

Shell _Hide "cmd /c wmic logicaldisk get caption >temp.txt"
Open "temp.txt" For Input As #1
Do Until EOF(1)
    Line Input #1, file$
    Print file$
Loop
Close

Sleep



Shell _Hide "cmd /c wmic logicaldisk get deviceid, volumename, description  >temp.txt"
Open "temp.txt" For Input As #1
Do Until EOF(1)
    Line Input #1, file$
    Print file$
Loop
Close

Sleep

Shell _Hide "cmd /c fsutil fsinfo drives >temp.txt"
Open "temp.txt" For Input As #1
Do Until EOF(1)
    Line Input #1, file$
    Print file$
Loop
Close

Sleep


Shell _Hide "powershell get-psdrive -psprovider filesystem >temp.txt "
Open "temp.txt" For Input As #1
Do Until EOF(1)
    Line Input #1, file$
    Print file$
Loop
Close

Sleep


Note that I've set some of the above to give just bare bone information, whereas other examples give more details.  The fsutil command will even give you listings of mapped drives, if you need those, while powershell can tell you everything under the sun, if you just care enough to give it the proper parameters and such.  

Note 2: Some of these return unicode names, and will appear to be with an extra space between each letter.  You can filter that out easily enough, if interested.
Reply


Messages In This Thread
Issue with code? - by bobkreid - 07-29-2022, 09:13 AM
RE: Issue with code? - by RhoSigma - 07-29-2022, 12:16 PM
RE: Issue with code? - by bobkreid - 07-29-2022, 02:43 PM
RE: Issue with code? - by JRace - 07-29-2022, 03:00 PM
RE: Issue with code? - by Pete - 07-29-2022, 05:40 PM
RE: Issue with code? - by JRace - 07-29-2022, 06:02 PM
RE: Issue with code? - by Pete - 07-29-2022, 06:24 PM
RE: Issue with code? - by SMcNeill - 07-29-2022, 06:50 PM
RE: Issue with code? - by Pete - 07-29-2022, 07:23 PM
RE: Issue with code? - by SMcNeill - 07-29-2022, 07:31 PM
RE: Issue with code? - by Pete - 07-29-2022, 07:56 PM
RE: Issue with code? - by bobkreid - 07-30-2022, 03:12 PM
RE: Issue with code? - by Pete - 07-30-2022, 04:02 PM
RE: Issue with code? - by JRace - 07-30-2022, 03:48 PM



Users browsing this thread: 11 Guest(s)