Using the VBS network module 
Author Message
 Using the VBS network module

I have a VBScript that is being ran from my NOVELL login script.
It works sparidically.
When I use this in a subroutine:
  Set WshNetwork = WScript.CreateObject("WScript.Network")
  UN = WshNetwork.UserName
I get the following error:
  The operation being requested was not performed because the
  user has not logged on to the network.
  The specified service does not exist.

Well like I said, this script is being run from a login script, If I wasn't
logged on to the network, I wouldn't be able to run the script in the first
place.

The weirdest part is that the error does not appear consistently (at least not
htat I've noticed). Sometimes the script completes with no errors, sometimes it
doesn't.

If there is anyone that has seen this before and knows a solution, I would
greatly appreciate it.

Matt Early



Thu, 19 Jun 2003 07:01:54 GMT  
 Using the VBS network module
Q233976 - Cannot Retrieve UserName Property in Windows Script Host
http://support.microsoft.com/support/kb/articles/Q233/9/76.ASP

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

--
Michael Harris
Microsoft.MVP.Scripting
--

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


I have a VBScript that is being ran from my NOVELL login script.
It works sparidically.
When I use this in a subroutine:
  Set WshNetwork = WScript.CreateObject("WScript.Network")
  UN = WshNetwork.UserName
I get the following error:
  The operation being requested was not performed because the
  user has not logged on to the network.
  The specified service does not exist.

Well like I said, this script is being run from a login script, If I wasn't
logged on to the network, I wouldn't be able to run the script in the first
place.

The weirdest part is that the error does not appear consistently (at least
not
htat I've noticed). Sometimes the script completes with no errors, sometimes
it
doesn't.

If there is anyone that has seen this before and knows a solution, I would
greatly appreciate it.

Matt Early



Thu, 19 Jun 2003 07:13:57 GMT  
 Using the VBS network module
Where is the vbscript run from?


I have a VBScript that is being ran from my NOVELL login script.
It works sparidically.
When I use this in a subroutine:
  Set WshNetwork = WScript.CreateObject("WScript.Network")
  UN = WshNetwork.UserName
I get the following error:
  The operation being requested was not performed because the
  user has not logged on to the network.
  The specified service does not exist.

Well like I said, this script is being run from a login script, If I wasn't
logged on to the network, I wouldn't be able to run the script in the first
place.

The weirdest part is that the error does not appear consistently (at least
not
htat I've noticed). Sometimes the script completes with no errors, sometimes
it
doesn't.

If there is anyone that has seen this before and knows a solution, I would
greatly appreciate it.

Matt Early



Thu, 19 Jun 2003 23:05:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. libraries, modules for vbs

2. creating vbs modules - simple question

3. VB6 class module turns into regular module using VB6 IDE

4. VBS and DTS as a VB module

5. Using several .js modules

6. using FSO over network drives using NETBIOS

7. Modules, Modules, Modules

8. Network error with Modules

9. How to pass back variables from called vbs from vbs using wsh

10. VBS & WMI and Network Adapter Configuration

11. VBS Script to Enable/Disable Network Cards in Win 2000/XP

12. Mapping Network Drive in VBS

 

 
Powered by phpBB® Forum Software