Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read Absolute Hard Disk Sector

Status
Not open for further replies.

BudiBambang

Programmer
Sep 27, 2003
18
ID
Pls help me, How to read absolute hard disk sector using Visual Basic ?

Thanks
 
Could you state your purpose for doing this?

Gerry
 
I want to protect my program/exe, so my exe can't run on another computer
 
If this is a question regarding an .exe then you should probably be posting in the VB forum. This is VBA - no exe.

Gerry
 
A starting point to grab disk infos:
Set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives
For Each d in dc
n = ""
s = s & d.DriveLetter & " - "
If d.DriveType = Remote Then
n = d.ShareName
ElseIf d.IsReady Then
n = d.VolumeName & " SN:" & Left(Hex(d.SerialNumber),4) & "-" & Right(Hex(d.SerialNumber),4)
End If
s = s & n & vbCrLf
Next
MsgBox s

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top