Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 15 of 15

Thread: HardDisk

  1. #1
    Join Date
    May 2009
    Posts
    75

    HardDisk

    Hi All;
    Between 2 HardDisks in AMS
    How can i get main serial's of HardDisks?
    Best

  2. #2
    Join Date
    Oct 2009
    Location
    Merton, United Kingdom
    Posts
    684
    Drive.Enumerate and Drive.GetInformation should help there. (I think these are the right function names.)

  3. #3
    Join Date
    May 2009
    Posts
    75
    In Drive.Enum we cant see HardDisk Name.

  4. #4
    Join Date
    Oct 2009
    Location
    Merton, United Kingdom
    Posts
    684
    Quote Originally Posted by lukas kain View Post
    In Drive.Enum we cant see HardDisk Name.


    Code:
    local Drives = Drive.Enumerate();
    local Constructed = "Drive information is as follows.\r\n";
    
    for K, V in pairs(Drives) do
    	local Information = Drive.GetInformation(V);
    	
    	if (Information) then
    		Constructed = Constructed..[[
    		Label: ]]..Information.Label..[[
    		File System: ]]..Information.FileSystem..[[
    		Serial Number: ]]..Information.SerialNumber..[[
    		Display Name: ]]..Information.DisplayName..[[
    		]];
    	else
    		Constructed = Constructed.."\r\nCouldn't get information for drive "..V..", Skipping..\r\n";
    	end
    end
    
    Dialog.Message("Information", Constructed);

  5. #5
    Join Date
    May 2009
    Posts
    75
    Dear Sakuya;
    Thanks for saple but
    in this how can i get HardDisk name like "MAXTOR G765UD"
    And how can i find that Drive C in wich HardDisk?

  6. #6
    Join Date
    Oct 2009
    Location
    Merton, United Kingdom
    Posts
    684
    Not possible with AutoPlay at the moment, a DLL or ActiveX component may help you though.

  7. #7
    Join Date
    May 2009
    Posts
    75
    I can Get Hardware ID.
    But i want to find if User have 2 HardDisks How Can i understand that Drive C:\ in wich one?
    Every body
    Help
    Regards

  8. #8
    Join Date
    Aug 2003
    Posts
    2,427
    Drive.GetType will provide the information you seem to need after you've enumerated the drives you can then get the type of each one.

  9. #9
    Join Date
    May 2009
    Posts
    75
    If I Have 2 HardDisks how can i find that Drive like D:\ For wich HardDisks?

  10. #10
    Join Date
    Aug 2003
    Posts
    2,427
    As mentioned previously use Drive.Enumerate. That will return a table containing e.g. A: C: D: E: and you can loop through table checking each drive type as you go.

  11. #11
    Join Date
    May 2009
    Posts
    75
    I Checked it.
    Whene i have 2 HardDisks that all fixed in my case and for example they have 4 Drive partition like C D E F
    All drive in Drive.type have a one type that is the :
    DRIVE_FIXED-3-The drive is a non-removable (fixed) drive.

  12. #12
    Join Date
    Oct 2009
    Location
    127.0.0.1
    Posts
    279
    There are 10 types of people in the world: those who understand binary, and those who don't.

  13. #13
    Join Date
    May 2009
    Posts
    75
    all think that i need CD\DVD Drive Label or type.
    But my question is not never it.
    I want to find how can i find "HardDisk" Label that wich Drive Partition is in use by it .
    Sampel:
    HardDisk: MAXTOR DR63TR Partmgr: C:\ , D:\
    HardDisk: TOSHIBA 788KU7 Partmgr:E:\
    How can i find That C:\ is in use by MAXTOR DR63TR

  14. #14
    Join Date
    May 2009
    Posts
    75

    HardDisk SerialNumber

    Hi All
    I find a new Function but I want convert it to AMS
    This Code is a VB Lang and Get HardDisk SerialNumber
    1- With API :
    Private Declare Function GetVolumeSerialNumber Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
    2- Define Var :
    Public Function DiscSerialNumber(ByVal RootPath As String) As String
    Dim VolLabel As String
    Dim VolSize As Long
    Dim Serial As Long
    Dim MaxLen As Long
    Dim Flags As Long
    Dim Name As String
    Dim NameSize As Long
    Dim S As String
    Dim r As Boolean
    r = GetVolumeSerialNumber(RootPath, VolLabel, VolSize, Serial, MaxLen, Flags, Name, NameSize)
    DiscSerialNumber = Serial
    End Function
    3- Call Function
    Text1.Text = DiscSerialNumber("c:\")

    Now you can get your SN HD with Certain Partition.
    Please Help to Convert it to AMS.
    Regards

  15. #15
    Join Date
    Apr 2006
    Posts
    127
    kernel32 is a Windows API DLL (Dynamic Link Library).

    Take a look at the AMS help on the DLL.CallFunction, you might get somewhere with that, but Basic is a good choice for this sort of thing. You could run a Basic program or DLL from your AMS program.

    Alternatively, one of the expert AMS users such as AMSWaves may be able to produce a plugin for you at reasonable cost:

    http://www.amswaves.com/

    AMSWaves already have a plugin that gives AMS projects the ability to use Visual Basic Scripts, which may be all you need.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts