network functions don't work in login scripts in 95 
Author Message
 network functions don't work in login scripts in 95

I wrote a login script using WSH that works fine for NT/2000, but 95 won't
process the WSH network functions.  For examnple, the network object won't
return the username property.  This functions works fine when I run the
script after the login.  I had similar problems with kixtart in the 95
environment.  Any ideas?

Thanks in advance,

Ken P.



Mon, 12 May 2003 03:00:00 GMT  
 network functions don't work in login scripts in 95

Q233976 - Cannot Retrieve UserName Property in Windows Script Host
http://support.microsoft.com/support/kb/articles/Q233/9/76.ASP

Q188602 - INFO: UserDomain Method Does Not Work Under Win95 with WSH
http://support.microsoft.com/support/kb/articles/Q188/6/02.ASP

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup...
--

Quote:

> I wrote a login script using WSH that works fine for NT/2000, but 95 won't
> process the WSH network functions.  For examnple, the network object won't
> return the username property.  This functions works fine when I run the
> script after the login.  I had similar problems with kixtart in the 95
> environment.  Any ideas?

> Thanks in advance,

> Ken P.



Mon, 12 May 2003 03:00:00 GMT  
 network functions don't work in login scripts in 95
The code in the MS KB article is as follows...

Dim strUserName
Set WSHNetwork = CreateObject("WScript.Network")
While strUserName = ""
    strUserName = WSHNetwork.UserName
WEnd

In my (and many other users) experience, this often needs to be modified as
follows...

Dim strUserName
Set WSHNetwork = CreateObject("WScript.Network")
On Error Resume Next
While strUserName = ""
    strUserName = WSHNetwork.UserName
WEnd
On Error Goto 0

I think it would be nice if Microsoft added this info to their KB article.

Andy Britton



Thu, 15 May 2003 03:00:00 GMT  
 network functions don't work in login scripts in 95
Your experience proved correct.  The Microsoft code didn't work for me, but
the revised code did the job.

Thanks!

-ken


Quote:
> The code in the MS KB article is as follows...

> Dim strUserName
> Set WSHNetwork = CreateObject("WScript.Network")
> While strUserName = ""
>     strUserName = WSHNetwork.UserName
> WEnd

> In my (and many other users) experience, this often needs to be modified
as
> follows...

> Dim strUserName
> Set WSHNetwork = CreateObject("WScript.Network")
> On Error Resume Next
> While strUserName = ""
>     strUserName = WSHNetwork.UserName
> WEnd
> On Error Goto 0

> I think it would be nice if Microsoft added this info to their KB article.

> Andy Britton



Fri, 16 May 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. vbscript login scripts - starting a script from the Windows 95 command prompt

2. Remote Script don't work on NT4 Server

3. Logon script don't work with wsh.

4. Login script problem in 95/98

5. it's work with windows NT not with Windows 95

6. Running vbs as a login script for Windows 95

7. Ghostscript's ps2ascii don't work

8. Nope, still don't got it -Map Network Drive across Domains

9. Mapped Network drives in My Computer Don't Display Properly

10. formatCurrency & formatNumber don't work

11. focus don't work in IE5.5

12. dynamically created anchors don't work

 

 
Powered by phpBB® Forum Software