WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

wNT
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

wntUserProps Questions

Keywords:     first last name of user

Question:

How do I get the full name of a NT user?

Answer:

wntUserProps(1) will do it.

It will also return for the Username:

Full name, Description, User profile path, Login script name, Home directory, Home directory logon drive.

Related Question:

I am using the following code to determine if a user has administrative rights on the local machine to perfom automated installs. I am getting a "562 Invalid User Name" error. Can you help?
	AddExtender("WWWNT34I.DLL")
	user=(wntUserInfo(0))
	priv=(wntUserProps("", user, 7))
	If priv<>"ADMIN"
	message("STOP","Your Privilege level, %priv% is not sufficent for this install. Please call 9-5000.")
	Exit
	EndIf 

Answer:

  1. Use wntGetUser instead of wntUserInfo. The wntUserProps functions wants the userid that wntGetUser returns, as opposed to the full name that wntUserInfo returns.

  2. Adding a DEBUG(1) to the top of your program will let you step thru it and debug it easier.

  3. Make sure the user has an account on the default server (not just a domain user).

  4. Does the user really have an account on the current machine, or is it a domain user? Try specifying a server name as the first parameter (maybe the PDC), and an actual user name for the second parameter (not a variable). Try a couple of users that you know have accounts on the specified server. Maybe try different a servername parameter. The one of the machine where the user really has an account.

Question (continued):

I am trying to get the profile path to the currently logged in user using the following code. It will not return a path. Do you know why?
	AddExtender("WWWNT34I.DLL")
	User=wntGetUser(@default)
	response=wntUserProps("", User, 3)
	message("The user profile path is:",response)

Answer:

  1. Maybe the user is not defined on the local machine, but rather via a domain controller (PDC) elsewhere, so you are asking wrong machine?

  2. If all of the user profiles reside in the winnt\profiles directory, and you are trying to locate the individuals local profile, you probably want ...
    	a=ShortCutDir("Start menu")
    	Message("Profile ???",a)
    

  3. If this is in a login script, and there's a timing issue involved, I've also heard of people having luck with something like...
    	While 1
    		user=wntGetUser(@default)
    		if user!="" then break
    		TimeDelay(0.5)
    	endwhile
    
    where it keeps hitting wntGetUser until it gets a username.

Question:

What is the purpose of wntUserProps("",acct,0)?

What I mean is, if you have to already have the account name to pass to the function then what is it going to return different from the account name that you already have to have to pass to it to begin with?

Answer:

No, wntUserProps(0) doesn't seem to have much purpose. Maybe if there were aliases or something? It's just one of the fields available, so tada, there it is.
Article ID:   W13584
Filename:   Get User Name and wntUserProps.txt
File Created: 2001:03:01:14:16:12
Last Updated: 2001:03:01:14:16:12