fredg wrote:
On Mon, 27 Mar 2006 22:13:16 -0500, MLH wrote:
I wish to give someone an A97 database they can install
on their PC as a runtime application. I want them to click
a button on a form (frmDocumentMyPC). I want to document
as much useful information about the PC as possible, save
the data in table(s) and print a nice report. I know how to
run IPconfig and read its output into Access tables.
I don't know how much useful information can be read
and saved, but I would like to get all that may prove of
some use to the owner. For example, could I determine
the owner's eMail address(es), what their default browser
is, the machine name, etc? Perhaps even count up all
the files/dirs, determine how much diskspace has been
used up on all the disks. I would like to explore the pos-
sibilities and am looking for a good place to start.
How about fixing your PC clock?
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
I agree. BTW, not that anyone would do this, but would installing
trial software with the system clock set to a bogus date in the future
work if the clock is set back to the present after the install? Don't
dying CMOS batteries cause the clock to slow down?
MLH,
Let me see if I understand the problem. You want the user to be able
to read their email address from their PC. E.g., (an email address I
looked up recently of someone who posted here long ago)
tg*@sfu.ca
Then you want to search some browser history. E.g., (examples of
places I browsed recently to try to get some information about the old
friend of this NG)
http://www.elinc.sfu.ca/people/people_16_tb.htm
or
http://groups.google.com/group/comp....57047ef04a7b81
or
http://groups.google.com/group/comp....c8d7b4ac79f6a2
Then you want to find out what the directories are. E.g., (fictitious,
humorous or speculative possibilities for directory names):
C:\eLINCPeopleDoingSideJobs
or
C:\AdministerProfitsFrom_aislebyaisle_com
or
C:\Databases\ShoppingList_mdb
(Note that any perceived hypothesis outlined above is based on the
flimsiest and most whimsical circumstantial evidence imaginable so
please don't take it seriously or bother anyone about it. Besides, if
by some very remote chance any of it is true he'll appreciate the free
publicity :-).)
Then you want to be able to find out how much hard drive space is used.
Am I close to understanding the problem?
For hard drive space try the API function:
'Code from knowledgebase article by Microsoft
Private Type LARGE_INTEGER
lowpart As Long
highpart As Long
End Type
Public Declare Function GetDiskFreeSpaceEx Lib "kernel32" Alias _
"GetDiskFreeSpaceExA" (ByVal lpRootPathName As String, _
lpFreeBytesAvailableToCaller As LARGE_INTEGER, lpTotalNumberOfBytes
_
As LARGE_INTEGER, lpTotalNumberOfFreeBytes As LARGE_INTEGER) As
Long
Private Function CLargeInt(Lo As Long, Hi As Long) As Double
'This function converts the LARGE_INTEGER data type to a double
Dim dblLo As Double, dblHi As Double
If Lo < 0 Then
dblLo = 2 ^ 32 + Lo
Else
dblLo = Lo
End If
If Hi < 0 Then
dblHi = 2 ^ 32 + Hi
Else
dblHi = Hi
End If
CLargeInt = dblLo + dblHi * 2 ^ 32
End Function
The code is used something like:
Public Function FreeSpaceA() As Double
Dim lResult As Long
Dim liAvailable As LARGE_INTEGER
Dim liTotal As LARGE_INTEGER
Dim liFree As LARGE_INTEGER
Dim dblAvailable As Double
Dim dblTotal As Double
Dim dblFree As Double
'Determine the Available Space, Total Size and Free Space of a drive
lResult = GetDiskFreeSpaceEx("A:\", liAvailable, liTotal, liFree)
'Convert the return values from LARGE_INTEGER to doubles
dblAvailable = CLargeInt(liAvailable.lowpart, liAvailable.highpart)
dblTotal = CLargeInt(liTotal.lowpart, liTotal.highpart)
dblFree = CLargeInt(liFree.lowpart, liFree.highpart)
'Display the results
'Debug.Print "Available Space: " & dblAvailable & " bytes (" & _
' Format(dblAvailable / 1024 ^ 3, "0.00") & " G) " & vbCr &
_
' "Total Space: " & dblTotal & " bytes (" & _
' Format(dblTotal / 1024 ^ 3, "0.00") & " G) " & vbCr & _
' "Free Space: " & dblFree & " bytes (" & _
' Format(dblFree / 1024 ^ 3, "0.00") & " G) "
FreeSpaceA = dblFree
End Function
Note:
http://www.microsoft.com is a good source of information for
answering these questions. You can use the Dir() function to traverse
the directories.
Email attachments should be found compressed (cab format?) in some
hidden and somewhat secret MS directories that look something like
MW3RW5IR. Try Googling.
Browser history should be in something like C:\Windows\Temporary
Internet Files\Content.IE5 but it depends on the particular OS.
For getting the email address maybe check the Outlook Object Model for
it or maybe it's stored in a Registry entry for the user's email
reader.
Maybe others can give more detailed answers to these questions.
Do you have any particular users in mind on whom to test this concept?
James A. Fortune
CD********@FortuneJames.com http://www.m-w.com/cgi-bin/dictionar...ouble+entendre