Posts: 1,769
Threads: 410
Joined: Feb 2003
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
Posts: 12,140
Threads: 142
Joined: Dec 2002
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:\
Posts: 12,140
Threads: 142
Joined: Dec 2002
:oops:
Use function GetVolumeInformation.
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
Posts: 1,769
Threads: 410
Joined: Feb 2003
sorry about that i put GetDriveType but meant GetVolumeInformation.
Posts: 1,271
Threads: 399
Joined: Mar 2003
i just had a deja vu
and when you what to set a drive label:
set drivelabel and win rollup
Posts: 1,769
Threads: 410
Joined: Feb 2003
i keep getting "Error in Macro: this name already exists." on GetVolumeInformation.
Posts: 12,140
Threads: 142
Joined: Dec 2002
Probably it exists or existed somewhere as WINAPI.GetVolumeInformation or WINAPI2.GetVolumeInformation. Try to restart QM.
Posts: 1,769
Threads: 410
Joined: Feb 2003
THAT's Got it...THANKS. 8)