471,594 Members | 2,240 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

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


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

On Error Resume Next

Dim WshNetwork
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "N:", "\\Sales2\customer\" '* Map drive N.

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


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\customer | Microsoft Windows Network
| N: | \\Sales2\customer | Web Client Network
OK | O: | \\Sales3\customer | 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
Oct 4 '07 #1
2 5263
I've FOUND the problem !!!!.

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

Oct 6 '07 #2
8,127 Expert 4TB
Question moved to HTML Forum.
Oct 6 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Dennis | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.