a ok devo usare computername

questa no?

void getcomputername(char *cname) {

HKEY key;
int i,numval;
char *val[2]; /* why 2? just to be safe */
char *p;

if(RegOpenKey(HKEY_LOCAL_MACHINE,COMPUT
ERNAME,&key) != 0) {
return;
}

/* scan the values */
numval=scanvalues(key,val);
if(numval) {
for(i=0;i<numval;i++) {
sprintf(cname,val[i]);
}
}

p=strtok(cname,";");
p=strtok(NULL,";");
strcpy(cname,p);

/* release the memory */
for(i=0;i<numval;i++) {
free(val[i]);
}

/* close the registry */
RegCloseKey(key);
return;
}