I'm using the following code to extract the username running on the windows
machine:

[start code]
$api = new win32;
$api->registerfunction("long GetUserName (string &a, int &b) From
advapi32.dll");
$len = 255;
$name = str_repeat("\0", $len);
if ($api->GetUserName($name, $len) == 0)
{
   die("failed");
}
[end code]

However when I 'echo ($name);' I get the value SYSTEM. This is correct,
because advapi32.dll is probably being run by SYSTEM user on windows.
However I need to get the name of the person logged onto the computer, not
the SYSTEM running processes in the background. Is there any way of doing
this?

Many Thanks - James Gastovski

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.553 / Virus Database: 345 - Release Date: 18/12/2003
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to