Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User name using vbscript

Status
Not open for further replies.

pedwards102

Technical User
Feb 4, 2002
2
0
0
US
Hi All

I wrote a vbscript to log users into a NT 4 domain. I map drives bases on user name and what group they belong to. The script works on windows 2000 pro and windows nt work station but I'm unable to retrieve the user name from a windows 98 computer. Is there a way to get the user name from a windows 98 computer using vbscript.
 
G'Day Mate,
I'm afraid i dont have an answer to your question here but i'd dearly love to get a copy of these logon scripts you have written.
I am in the process of doing something similar where i work & am always looking for ways to NOT reinvent the wheel!
Hope you dont mind sharing.
Regards
Nick
 
I think it was in the Windows Script Host Developers Guide (Gunter Born) wher a routine as follows was suggested for your situation.
Code:
Set WshNetwork = WScript.CreateObject("WScript.Network")
User = ""
Do While User = ""
    User = WshNetwork.UserName
    WScript.Sleep 200
Loop
This is needed on Win 95/98 because the script is running before being logged on to the network.

A.C.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top