Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

sys(0) help

sys(0) help

sys(0) help

Something happened to one of my client's workstations.  My applications calls sys(0) to grab the machine name or user name.  This has always worked, until something happened on one of the machines.  I can't remember where this comes from either.  Any ideas?

RE: sys(0) help

The network shell controls what, if anything, is returned by SYS(0).  Generally, for external clients it is inadvisable to use, because the return value is pretty unpredictable - it depends on desktop OS, network OS, and version.  If a machine is not connected to a network, it may be blank or "1".

For WinNT/Win2000, it seems to be the current computer user's name.

Robert Bradley

FoxDev - Visual FoxPro Development

RE: sys(0) help

My application written in FoxPro2.6w has run on this novell network with windows 95 for years.  One users crashed his machine and the only thing we can't get back is his network name....grabbed by sys(0).  Everyone else on the network is working fine.  I'll check the login script, that rings a bell.


RE: sys(0) help

Since you use Novell,  In the Network Login Script add the line
username = %LOGIN_NAME%

then in the Fox Application use the line
ucNetName = upper(alltrim(getenv("USERNAME")))

David W. Grewe

RE: sys(0) help

How do I find the login script?

RE: sys(0) help

Just like Bob said, SYS(0) returns the network machine name (the ones you can see on the Network Neighborhood) in a Windows 95/NT environment. But Novell can override SYS(0) return value using its "MACHINE" environment variable. Whenever you assign value to MACHINE variable that is set within the login script, it forces SYS(0) to capture that value.
Login scripts are sets of batch commands that Novell executes whenever a valid user logs on to the network. You have to consult your network administrator when dealing with login script info.

RE: sys(0) help

Thanks, the person who we can't get the user name with sys(0) is also not showing up in Network Neighborhood.  Thanks for everyones advice.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close