Docpro777


Dearest Friends, FoxMasters, Geeks and/or venerable MVPs,

Looking at Sys() commands, etc. I can't seem to be able to 'display' a name for the LAN Server(s). Sys(5) works for the "Drive" of course, but Sys(5) fails to be meaningful for a Server Name:

...eg. "DellDimension4300", "Martha", "Ivan", "MyLanServer", etc.

I've searched help files repeatedly to just find a way to display the lan-server name, but failed.

(As always, much thanks and respect for your precious time and thoughts.)





Re: Server Name?

CetinBasoz


Do you mean sys(0) or ID() (it has computername + username).




Re: Server Name?

dni

You may use:

http://www.news2news.com/vfp/ group=49&function=254

to retrieve server name.







Re: Server Name?

Docpro777

Thank you Cetin for your extremely thoughtful reply.

Those only seem to work for "client" (the way I coded); eg., "MyClientComputer"

(I haven't figured how to make it work for MyLanServer, though.)

Thanks






Re: Server Name?

Dannible

You could use:

GETENV("COMPUTERNAME")





Re: Server Name?

Docpro777

Thanks DNI,

Please give me some time to work with that Win API code and I'll try to let you know results, ASAP.






Re: Server Name?

Docpro777

OK Dan: GETENV("COMPUTERNAME")

I'll try it and try to get back ASAP.

Thanks exceedingly for your thoughts on this.






Re: Server Name?

Docpro777

I've tried"

set default to x:\myServerDir && server directory

and GETENV("COMPUTERNAME") returns same as sys(0) and ID()

I'll research and get back.

Thanks






Re: Server Name?

Docpro777

DNI,

I confess, I can't figure out the win32 parameters:

DECLARE INTEGER NetGetDCName IN netapi32;

STRING servername,;

STRING domainname,;

INTEGER @ bufptr

I tried:

NetGetDCName("","",0) && numeric value !

NetGetDCName(0,0,0) && numeric value !

I'll keep trying.

I'll also research 'shell' and/or scripting at this point.

Thanks for all






Re: Server Name?

Docpro777

OK I found the answer (finally): To get the server (volume) name we can use ADIR() ...

FOR n = 1 TO ADIR(aFiles,"","V") && Creates an array of 1 element ... the volume of the server based on default directory (other than home)

lVolume = aFiles(n)

ENDFOR

Thanks all for helping me think this one through.