cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Madhu_Mitra
Level 3

Getting Drive Information

Hi,
I need to find out that if a drive selected is local drive or Network or anyother. In a nutshell I need to find the drive type. I have been trying using the code


di.szDiskPath = szDir;
di.nInfoToQuery = DISK_INFO_QUERY_DRIVE_TYPE;
svResult = GetDiskInfo(&di);

but Installscript return error for the code svResult = GetDiskInfo(&di);


What is the correct method to find drive information.


Madhu
Labels (1)
0 Kudos
(2) Replies
MSIYER
Level 8

Start here:
http://msdn.microsoft.com/en-us/library/aa364939(v=vs.85).aspx

Use Kernel32.dll in your Installscript code.
Something like:
prototype BOOL KERNEL32.GetComputerName ( BYREF STRING, BYREF NUMBER );

Then use the dll :
UseDLL ("kernel32.dll"); in your code and call the appropriate function. In your case GetDriveType().

Hope this helps.
0 Kudos
Madhu_Mitra
Level 3

Thank you for the reply. I have been able to achieve it using the following code

di.szDiskPath = szDir;
di.nInfoToQuery = DISK_INFO_QUERY_DRIVE_TYPE;
if GetDiskInfo(&di) = ISERR_SUCCESS then
if di.nDriveType != DRIVE_FIXED then
MessageBox ("Not a Fixed Drive", INFORMATION);
endif;
endif;
0 Kudos