|
Thank You very much ...
I get your code run to VB is Error.
But I don't Know "YOU MUST HAVE WMI INSTALLED AND A REFERENCE TO Microsoft WMI Scripting Library IS REQUIRED" How to get WMI Scripting Library ?..
|
|
|
|
|
Thank You very much ...
I get your code run to VB is Error.
But I don't Know "YOU MUST HAVE WMI INSTALLED AND A REFERENCE TO Microsoft WMI Scripting Library IS REQUIRED" How to get WMI Scripting Library ?..
|
|
|
|
|
If you have Windows 2000, XP or above WMI installed automatically.
In VB, select refrences from project menu, then in opened dialog find WMI, and select it.
Now, press F5 and run program.
A. Riazi
|
|
|
|
|
Hello,
PC have two disk.
on windows system, C,D,E contain in first hard disk and
G,H contain in twice hard disk.
in this case,
how to get drive letters(G,H) of twice hard disk?
or
how to know that drive G,H contain in twice hard disk?
thanks in advanced.
Jessonel.
|
|
|
|
|
For extracting drive letters you can use GetLogicalDrive() and GetLogicalDriveStrings() functions.
But if you want to know drive letters on specified hard disk drive, you must use DeviceIoControl() function with proper control code. In this situation, use IOCTL_DISK_GET_DRIVE_LAYOUT_EX control code (Disk Management Control Codes).
Refer to MSDN for more information on this topic.
A. Riazi
|
|
|
|
|
I need some help to read the serial number from the main board (from bios and not from the registry!
Can you help me? The code shall be in C or C++.
Thank you
|
|
|
|
|
Serial number of what?
A. Riazi
|
|
|
|
|
How I can get the Motherboard Serial number?
|
|
|
|
|
|
I found there many useful tools, but missing one function, exactly how to extract HDD serial number.
Can somebody give me an advice?
Thanks.
|
|
|
|
|
Try this code:
char VolumeName[200]="";
char FileSystem[50]="";
DWORD VolumeSerialNumber=0;
DWORD MaxFileName=0;
DWORD dwFileSystem=0;
GetVolumeInformation("c:\\", VolumeName, sizeof(VolumeName),
&VolumeSerialNumber, &MaxFileName, &dwFileSystem, FileSystem, sizeof(FileSystem));
CString VolumeSerialNum;
VolumeSerialNum.Format("%X",VolumeSerialNumber);
VolumeSerialNum= VolumeSerialNum.Left(4) + CString("-") + VolumeSerialNum.Right(4);
A. Riazi
|
|
|
|
|
You must use SMART to accomplish this task.
Many people confuses volume serial number with hard disk serial number
|
|
|
|
|
Pardon my ignorance, but what is SMART?
Regards,
Dejan Petrovic
|
|
|
|
|
SMART is abbrevation of these words:
Self-Monitoring Analysis & Reporting Technology
Self-Monitoring Analysis and Reporting Technology (S.M.A.R.T.) is an interface between a computer's start-up program or BIOS (basic input/output system) and the computer hard disk. It is a feature of the Enhanced Integrated Drive Electronics (EIDE) technology that controls access to the hard drive. If S.M.A.R.T is enabled when a computer is set up, the BIOS can receive analytical information from the hard drive and determine whether to send the user a warning message about possible future failure of the hard drive.
(visit whatis.com[^] for more information).
A. Riazi
|
|
|
|
|
Yes this is correct. You can get the serial number too via SMART.
The SMART do not need to be enabled in BIOS to an software access it.
Search the microsoft web site to find a sample (or msdn)
|
|
|
|
|
|
Nice article. But you are missing the "OXVerInfo.h" from the source distribution.
Can you re-upload your source dsitribution with this enclosed?
Jon Burgstrom
I once thought about...... Oh forget it....
|
|
|
|
|
Hi,
Because this article is part of my work, I forgot to remove this line in my project. It is part of a third party library and I can not include it in my project. I use this header file to determine version number of any dll and exe file.
Remove this line and recompile the project.
A. Riazi
|
|
|
|
|
Jon Burgstrom wrote:
But you are missing the "OXVerInfo.h"
That's part of Dundas Ultimate Toolbox.
Victor.
phpWebNotes is a page annotation system modelled after php.net.
http://webnotes.sourceforge.net/demo.php[^]
|
|
|
|
|
I commented out the header file "OXVerInfo.h" as the author is suggesting, but I still get the following undeclared identifiers: CSIDL_WINDOWS, CSIDL_SYSTEM, CSIDL_LOCAL_APPDATA, CSIDL_MYDOCUMENTS, CSIDL_PROGRAM_FILES, CSIDL_ADMINTOOLS, CSIDL_PROFILE, CSIDL_COMMON_ADMINTOOLS, CSIDL_COMMON_APPDATA, CSIDL_COMMON_DOCUMENTS,
CSIDL_COMMON_TEMPLATES. It seems something is missing from the project.
|
|
|
|
|
As I mentioned in requirements section, you must have the latest Platform SDK. These definitions will be find there.
For installing PSDK, refer to Microsoft PSDK web page.
A. Riazi
|
|
|
|
|
Its a good work.But more explanation would be better.
|
|
|
|
|
This is my way. I have had the file SysInfo.exe.
You can create the file. the filename is OXVerInfo.h
Context is follow:
//--------------OXVerInfo.h----------------------//
//Create date:2003-02-15 //
//Designer: lixding@dnc.hit.edu.cn //
//-----------------------------------------------//
/*
The content was downloaded from
url://http://www.wac-jp.com/programmers/win32/GetSpecialFolder.shtml
*/
#define CSIDL_DESKTOP 0x0000 // <desktop>
#define CSIDL_INTERNET 0x0001 // Internet Explorer (icon on desktop)
#define CSIDL_PROGRAMS 0x0002 // Start Menu\Programs
#define CSIDL_CONTROLS 0x0003 // My Computer\Control Panel
#define CSIDL_PRINTERS 0x0004 // My Computer\Printers
#define CSIDL_PERSONAL 0x0005 // My Documents
#define CSIDL_FAVORITES 0x0006 // <user name>\Favorites
#define CSIDL_STARTUP 0x0007 // Start Menu\Programs\Startup
#define CSIDL_RECENT 0x0008 // <user name>\Recent
#define CSIDL_SENDTO 0x0009 // <user name>\SendTo
#define CSIDL_BITBUCKET 0x000a // <desktop>\Recycle Bin
#define CSIDL_STARTMENU 0x000b // <user name>\Start Menu
#define CSIDL_MYDOCUMENTS 0x000c // logical "My Documents" desktop icon
#define CSIDL_MYMUSIC 0x000d // "My Music" folder
#define CSIDL_MYVIDEO 0x000e // "My Videos" folder
#define CSIDL_DESKTOPDIRECTORY 0x0010 // <user name>\Desktop
#define CSIDL_DRIVES 0x0011 // My Computer
#define CSIDL_NETWORK 0x0012 // Network Neighborhood
#define CSIDL_NETHOOD 0x0013 // <user name>\nethood
#define CSIDL_FONTS 0x0014 // windows\fonts
#define CSIDL_TEMPLATES 0x0015
#define CSIDL_COMMON_STARTMENU 0x0016 // All Users\Start Menu
#define CSIDL_COMMON_PROGRAMS 0X0017 // All Users\Start Menu\Programs
#define CSIDL_COMMON_STARTUP 0x0018 // All Users\Startup
#define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019 // All Users\Desktop
#define CSIDL_APPDATA 0x001a // <user name>\Application Data
#define CSIDL_PRINTHOOD 0x001b // <user name>\PrintHood
#define CSIDL_LOCAL_APPDATA 0x001c
// <user name>\Local Settings\Applicaiton Data (non roaming)
#define CSIDL_ALTSTARTUP 0x001d // non localized startup
#define CSIDL_COMMON_ALTSTARTUP 0x001e // non localized common startup
#define CSIDL_COMMON_FAVORITES 0x001f
#define CSIDL_INTERNET_CACHE 0x0020
#define CSIDL_COOKIES 0x0021
#define CSIDL_HISTORY 0x0022
#define CSIDL_COMMON_APPDATA 0x0023 // All Users\Application Data
#define CSIDL_WINDOWS 0x0024 // GetWindowsDirectory()
#define CSIDL_SYSTEM 0x0025 // GetSystemDirectory()
#define CSIDL_PROGRAM_FILES 0x0026 // C:\Program Files
#define CSIDL_MYPICTURES 0x0027 // C:\Program Files\My Pictures
#define CSIDL_PROFILE 0x0028 // USERPROFILE
#define CSIDL_SYSTEMX86 0x0029 // x86 system directory on RISC
#define CSIDL_PROGRAM_FILESX86 0x002a // x86 C:\Program Files on RISC
#define CSIDL_PROGRAM_FILES_COMMON 0x002b // C:\Program Files\Common
#define CSIDL_PROGRAM_FILES_COMMONX86 0x002c // x86 Program Files\Common on RISC
#define CSIDL_COMMON_TEMPLATES 0x002d // All Users\Templates
#define CSIDL_COMMON_DOCUMENTS 0x002e // All Users\Documents
#define CSIDL_COMMON_ADMINTOOLS 0x002f
// All Users\Start Menu\Programs\Administrative Tools
#define CSIDL_ADMINTOOLS 0x0030
// <user name>\Start Menu\Programs\Administrative Tools
#define CSIDL_CONNECTIONS 0x0031 // Network and Dial-up Connections
#define CSIDL_COMMON_MUSIC 0x0035 // All Users\My Music
#define CSIDL_COMMON_PICTURES 0x0036 // All Users\My Pictures
#define CSIDL_COMMON_VIDEO 0x0037 // All Users\My Video
#define CSIDL_RESOURCES 0x0038 // Resource Direcotry
#define CSIDL_RESOURCES_LOCALIZED 0x0039 // Localized Resource Direcotry
#define CSIDL_FLAG_CREATE 0x8000
// combine with CSIDL_value to force folder creation in SHGetFolderPath()
#define CSIDL_FLAG_DONT_VERIFY 0x4000
// combine with CSIDL_value to return an unverified folder path
#define CSIDL_FLAG_NO_ALIAS 0x1000
// combine with CSIDL_value to insure non-alias versions of the pidl
#define CSIDL_FLAG_PER_USER_INIT 0x0800
// combine with CSIDL_value to indicate per-user init (eg. upgrade)
#define CSIDL_FLAG_MASK 0xFF00 // mask for all possible flag values
//-------------------------The End---------------------//
|
|
|
|
|
Dear friend,
OXVerInfo.h is part of Dundas Ultimate Toolbox not definition of special folders. you can find these definitions in Microsoft Platform SDK (PSDK).
Regards,
A. Riazi
|
|
|
|
|
Hi:
You are right. But I just want to compile it,It is temporary way.
SDK is large,so I want not download and install it.Thank for your
great job.
|
|
|
|