Problem with GetVolumeInformation in Visual Basic 6

Status
Not open for further replies.

Mr. Kiran V. Sutar

Newbie level 4
Joined
Dec 17, 2003
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Mumbai, India
Activity points
133
getvolumeinformation windows xp

Hi Forum Members,
I have written a following small routine in VisualBasic6:



Purpose:
To read the Volume Serial Number of the HDD (C:\).

Problem:
The above code works well on Windows98, and shows the Volume Serial Number correctly.
If I execute the same code on Windows XP, sometimes it works and sometimes it doesn't. Following are the tested conditions where it works and where it does not work:

Test 1: WindowsXP (Laptop) having OfficeXP, NTFS File System, Logged as Administrator. It works OK.

Test 2: Windows XP (StandAlone Desktop PC), having OfficeXP, FAT32 File System, Logged as User having Administrative rights. It works OK.

Test 3: Windows XP (PC connected to NT Network), having WindowsXP on C Drive, NTFS File System, Logged as user having administrative rights. it does NOT work. the volume serial number is returned as 0.

Please inform me if I am doing any mistake in the coding or testing. :?: My basic intention is to read the Serial Number of the C Drive in all of the Windows Operating Systems.

Thanking you in advance.

With best regards from,
Mr. Kiran V. Sutar.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…