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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Network path was not found 1

Status
Not open for further replies.

tripp2222

Technical User
Nov 30, 2004
32
US
I am receiving the message "An error has occurred in script." "The network path was not found." Then the script points to the below code.

'DomainString = WshShell.ExpandEnvironmentStrings("%USERDOMAIN%")
Set UserObj = GetObject("WinNT://schwans/" & strUserID)
strFullName = UserObj.FullName
intFirstName = InStr(strFullName, " ")
strFirstName = Left(strFullName,intFirstName - 1)
strLastName = Right(strFullName, Len(strFullName) - intFirstName)
'WScript.echo "First name: " & strFirstName
'WScript.echo "Last name: " & strLastName

The code works successfully on a regular setup PC, but I get the network path cannot be found when I use the same application on a terminal service machine. Any help would be greatly appreciated.


 
Have you tried using the FQDN with the WinNT provider? Have you tried using LDAP instead?

Just a suggestion to get your FirstName and LastName using the WinNT provider.

arrName = Split(UserObj.FullName, " ")
strFirstName = arrName(0)
strLastName = arrName(1)

dm4ever
--------------------------------------------------------------------------------
My approach to things: K.I.S.S - Keep It Simple Stupid
 
To be real honest I have never tried to use FQDN with the WinNT provider. I will need to research it out.
 
To be honest, neither have I; just felt like throwing something out there. If you want to try something similar with LDAP, give this a try:

Set objSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
strFirstName = objUser.GivenName
strLastName = objUser.SN
WScript.echo "First name: " & strFirstName
WScript.echo "Last name: " & strLastName

dm4ever
--------------------------------------------------------------------------------
My approach to things: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top