Page 1 of 1

Posted: Sun Jan 26, 2003 8:35 pm
by BackupUser
Restored from previous forum. Originally posted by CONVERT.

Well, it is more an API question than a PB question...

When a client Windows is loging in a MS network with a domain name, it executes a user.bat from \\BDC_server\NETLOGON.

This user.bat executes a .EXE made with PB. In this .EXE there is a Getusername call.

If the client PC is a Win 9x, it does not work. If the client is XP or NT, it works fine.

And it works fine when executed outside (or after) the login script, in Win 9x, and of course XP and NT.

It seems that during the login script, Windows 9x has not the time to record the username in the appropriate place.

May be is it better looking for the user name in HKEY_LOCAL_MACHINE\Network\Logon\username ?

Any idea?

Thanks
Jean.

Posted: Sun Jan 26, 2003 9:03 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

> If the client PC is a Win 9x, it does not work.

This code works fine on both Win 9x and Win 2K:

viewtopic.php?t=4409

Posted: Tue Jan 28, 2003 3:33 pm
by BackupUser
Restored from previous forum. Originally posted by CONVERT.
Originally posted by PB

> If the client PC is a Win 9x, it does not work.

This code works fine on both Win 9x and Win 2K:

viewtopic.php?t=4409
I already saw this contribution. It works outside the login script, but not during the login script. Try it on a Win 9x, you'll see.

I tried also to read directly the register value in
HKEY_LOCAL_MACHINE\Network\Logon\username.

During the login script, it gives the precedent username.

After the login script, it gives the current username.

I solved my problem by using the old 8-bits PUTINENV.EXE before my program, to obtain the username in the environment variable %USERNAME%. In this way, it works, even during login script.

Posted: Tue Jan 28, 2003 4:03 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

> I solved my problem by using the old 8-bits PUTINENV.EXE before my
> program, to obtain the username in the environment variable
> %USERNAME%. In this way, it works, even during login script.

Could you use this tip instead, to avoid using PutInEnv.exe?

viewtopic.php?t=2560

It should work?