Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
drive volume name
#1
i'm trying to get the volume name of the drive but can't seem to get it.

im trying the winapi GetDriveType; is that even doable?


http://support.microsoft.com/default.as ... en-us;1395
An old blog on QM coding and automation.

The Macro Hook
#2
There are several examples in the forum.

The reason may be missing backslash. MSDN says "A trailing backslash is required.". I did not use it in examples, sorry.

c:

|
v

c:\
#3
:oops:

Use function GetVolumeInformation.

Code:
Copy      Help
dll kernel32 #GetVolumeInformation $lpRootPathName $lpVolumeNameBuffer nVolumeNameSize *lpVolumeSerialNumber *lpMaximumComponentLength *lpFileSystemFlags $lpFileSystemNameBuffer nFileSystemNameSize

str s.all(100)
GetVolumeInformation "e:\" s 100 0 0 0 0 0
;out _s.dllerror
s.fix
if(!s.len) s="e" ;;not set
out s
#4
sorry about that i put GetDriveType but meant GetVolumeInformation.
An old blog on QM coding and automation.

The Macro Hook
#5
i just had a deja vu Smile

and when you what to set a drive label:
set drivelabel and win rollup
pi
#6
i keep getting "Error in Macro: this name already exists." on GetVolumeInformation.
An old blog on QM coding and automation.

The Macro Hook
#7
Probably it exists or existed somewhere as WINAPI.GetVolumeInformation or WINAPI2.GetVolumeInformation. Try to restart QM.
#8
THAT's Got it...THANKS. 8)
An old blog on QM coding and automation.

The Macro Hook


Forum Jump:


Users browsing this thread: 1 Guest(s)