Cant view any files using CreateObject("WScript.Network")

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • moodyman13
    New Member
    • Sep 2007
    • 6

    Cant view any files using CreateObject("WScript.Network")

    Hi all,
    Hoping someone can help me. I'm using WSH to automatically map a network drive when someone opens a webpage. Below are the codes

    <HTML>
    <Body>

    <script language="VBScr ipt" type="text/vbscript">
    Option Explicit

    On Error Resume Next

    Dim WshNetwork
    Set WshNetwork = CreateObject("W Script.Network" )
    WshNetwork.MapN etworkDrive "N:", "\\Sales2\custo mer\" '* Map drive N.

    If Err.Number <> 0 Then '* Check to make sure the operation succeeded.
    ‘Error message
    End If
    </script>

    </BODY>
    </HTML>

    No issue with mapping the drive using the above code. BUT when I try to view files / folders within N drive, there's no information there. There should be stacks of files/folders/subfolders but it’s blank !!!!. When I check the drive using Net Use in DOS, this is what I’ve got

    Status | Local | Remote | Network
    OK | M: | \\Sales1\custom er | Microsoft Windows Network
    | N: | \\Sales2\custom er | Web Client Network
    OK | O: | \\Sales3\custom er | Microsoft Windows Network

    I thought perhaps "Web Client network" might be part of the problem. If so, what are the options to fix the problem

    I hope someone can explain what went wrong before I go nuts !!!
    Thanks in advance
  • moodyman13
    New Member
    • Sep 2007
    • 6

    #2
    I've FOUND the problem !!!!.

    Instead of typing - "N:", "\\Sales2\custo mer" , I have typed - "N:", "\\Sales2\custo mer\" for the network path. So it an extra "\" that caused all the problem.

    Cheers

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      Question moved to HTML Forum.

      Comment

      Working...