HDD Number

This is a discussion on HDD Number within the cobol forums in Programming Languages category; is there a function in cobol that i can get my HDD number, or chip number or some other unique single user identification ? tks a lot!...

Go Back   Application Development Forum > Programming Languages > cobol

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-05-2008, 07:25 AM
mario
Guest
 
Default HDD Number

is there a function in cobol that i can get my HDD number, or chip
number or some other unique single user identification ?

tks a lot!
Reply With Quote
  #2  
Old 08-05-2008, 11:33 AM
Kellie Fitton
Guest
 
Default Re: HDD Number

On Aug 5, 4:25*am, mario <mmc_vw1...@hotmail.com> wrote:
> is there a function in cobol that i can get my HDD number, or chip
> number or some other unique single user identification ?
>
> tks a lot!




Hi,

There are no COBOL functions that can get a unique system ID.
But, if you are willing and able to use the Windows Management
Instrumentation classes, then....

You can use the same installation ID of the operating system
to get a globally unique ID for a given machine. The following
WMI class should help you out:

Win32_WindowsProductActivation

Or, you can use the following WMI class to get the manufacturer's
serial number used to identify the physical media:

Win32_PhysicalMedia

http://msdn2.microsoft.com/En-US/library/aa394520.aspx

http://msdn2.microsoft.com/en-us/library/Aa394346.aspx

Kellie.

Reply With Quote
  #3  
Old 08-05-2008, 11:51 AM
SkippyPB
Guest
 
Default Re: HDD Number

On Tue, 5 Aug 2008 04:25:33 -0700 (PDT), mario
<mmc_vw1200@hotmail.com> wrote:

>is there a function in cobol that i can get my HDD number, or chip
>number or some other unique single user identification ?
>
>tks a lot!


Short answer- no.

Regards,
////
(o o)
-oOO--(_)--OOo-

"Bigamy is having one wife too many. Monogamy is the
same."
--- Oscar Wilde
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Remove nospam to email me.

Steve
Reply With Quote
  #4  
Old 08-05-2008, 02:16 PM
billious
Guest
 
Default Re: HDD Number


"mario" <mmc_vw1200@hotmail.com> wrote in message
news:a031ca82-2711-4044-b02b-9e0cbb32a31e@a70g2000hsh.googlegroups.com...
> is there a function in cobol that i can get my HDD number, or chip
> number or some other unique single user identification ?
>
> tks a lot!


Presuming you're going through WINDOWS, would retrieving the value of
USERNAME from the environment suit your purpose, or could you arrange for a
unique environment variable to retrieve?


Reply With Quote
  #5  
Old 08-05-2008, 03:32 PM
Richard
Guest
 
Default Re: HDD Number

On Aug 5, 11:25*pm, mario <mmc_vw1...@hotmail.com> wrote:
> is there a function in cobol that i can get my HDD number, or chip
> number or some other unique single user identification ?


The MAC address on your NIC should be globally unique. On Linux /sbin/
ifconfig will list the network cards with the hardware address. On
Windows it may be ipconfig and this should give the 6 byte physical
address.

You should be able to use something like:

CALL "SYSTEM" USING "ipconfig >networkdata" & x"00"

and then read the resulting file to extract the required item.

Warning: just because that number is burned onto the network card does
not mean that if/ip config actually gets it from there. There is a
driver between the utility and the card and anything can happen
between, and often does.

Reply With Quote
  #6  
Old 08-06-2008, 12:08 AM
Richard
Guest
 
Default Re: HDD Number

On Aug 6, 3:33*am, Kellie Fitton <KELLIEFIT...@yahoo.com> wrote:
> On Aug 5, 4:25*am, mario <mmc_vw1...@hotmail.com> wrote:
>
> > is there a function in cobol that i can get my HDD number, or chip
> > number or some other unique single user identification ?

>
> > tks a lot!

>
> Hi,
>
> There are no COBOL functions that can get a unique system ID.
> But, if you are willing and able to use the Windows Management
> Instrumentation classes, then....
>
> You can use the same installation ID of the operating system
> to get a globally unique ID for a given machine. *The following
> WMI class should help you out:
>
> * * * * Win32_WindowsProductActivation


I suspect that this need not be 'globally unique'. For example in
corporates where machines are cloned with a corporate license will
they not be all the same ?


> Or, you can use the following WMI class to get the manufacturer's
> serial number used to identify the physical media:
>
> * * * * Win32_PhysicalMedia


What happens when the OS is running on virtualised hardware ?


> http://msdn2.microsoft.com/En-US/library/aa394520.aspx
>
> http://msdn2.microsoft.com/en-us/library/Aa394346.aspx


Your suggestion is also a Windowsie thing and this may not be mario's
environment.

Reply With Quote
  #7  
Old 08-06-2008, 11:42 AM
Kellie Fitton
Guest
 
Default Re: HDD Number

On Aug 5, 9:08*pm, Richard <rip...@azonic.co.nz> wrote:
>
> I suspect that this need not be 'globally unique'. For example in
> corporates where machines are cloned with a corporate license will
> they not be all the same ?
>
> What happens when the OS is running on virtualised hardware ?
>




Hi Richard,

There are no truly unique machine identifiers, PC and PC
compatible computers do not have unique IDs. The serial
number of an ATA hard disc unit uniquely identifies that ATA
hard disc. The serial number of an Intel CPU uniquely identifies
that CPU. The "machine SID" created by Windows NT uniquely
identifies that installation of Windows NT.

In a network environment, the MAC address is unique on a given
network segment, but duplications certainly can exist on different
segments. Moreover, changing the MAC address is not so difficult,
maybe Mario should look into the commercial packages for software
licensing.

Kellie.

Reply With Quote
  #8  
Old 08-06-2008, 03:24 PM
Richard
Guest
 
Default Re: HDD Number

On Aug 7, 3:42*am, Kellie Fitton <KELLIEFIT...@yahoo.com> wrote:
> On Aug 5, 9:08*pm, Richard <rip...@azonic.co.nz> wrote:
>
>
>
> > I suspect that this need not be 'globally unique'. For example in
> > corporates where machines are cloned with a corporate license will
> > they not be all the same ?

>
> > What happens when the OS is running on virtualised hardware ?

>
> Hi Richard,
>
> There are no truly unique machine identifiers, *PC and PC
> compatible computers do not have unique IDs. *The serial
> number of an ATA hard disc unit uniquely identifies that ATA
> hard disc.


Only if the manufacturer has actually put a unique number in the ROM
of the drive. Many put a generic number by batch.

>*The serial number of an Intel CPU uniquely identifies
> that CPU. *The "machine SID" created by Windows NT uniquely
> identifies that installation of Windows NT.


The question I asked was whether, in fact, it is unique when
corporates clone machines.

> In a network environment, the MAC address is unique on a given
> network segment, *but duplications certainly can exist on different
> segments.


The MAC address on a NIC is allocated to manufacturers by the IEEE and
is unique to every ethernet or WiFi card. It is burned on the card but
may, of course, be spoofed.

It has nothing to do with segments which is based on IP address which
is quite different.

>*Moreover, changing the MAC address is not so difficult,


Nor any of the others.

> maybe Mario should look into the commercial packages for software
> licensing.


Reply With Quote
  #9  
Old 08-08-2008, 03:03 AM
mario
Guest
 
Default Re: HDD Number

is there a way to get the mac-address via cobol??
Reply With Quote
  #10  
Old 08-08-2008, 07:43 AM
Pete Dashwood
Guest
 
Default Re: HDD Number



"mario" <mmc_vw1200@hotmail.com> wrote in message
news:de61a063-3f15-40f5-b505-d6fb968fe8c7@k13g2000hse.googlegroups.com...
> is there a way to get the mac-address via cobol??


Yes. Richard posted it to this thread 3 days ago.

You can shell and run "ipconfig" (redirecting the output to a simple text
file then reading the text file.) or you might consider running "ipconfig"
directly through the windows API.

You never said whether you are running Windows or not, and you never stated
which version of COBOL you are running. These things have a bearing on the
solution.

Pete.
--
"I used to write COBOL...now I can do anything."


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:57 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.