473,396 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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

<HTML>
<Body>

<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
</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\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 5533
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.

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

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

Similar topics

5
by: Bill | last post by:
I used to be able to run the following ASP code on our corp machine (W2K Server Edition and IIS-5) and successfully send a net-msg to anyone on our intranet. Last week it stopped working... and...
5
by: Rosa | last post by:
Hi, I'm trying to clear the TIF on Windows XP programmatically with the below code. This code works fine on any folder but the TIF. For some reason the atEnd() statements always defaults to true...
5
by: KC | last post by:
Hi, I have code similar to this.. Dim xlApp As Object xlApp = CreateObject("Excel.Application", "\\MyServer") The call is from a asp.net (Intranet) application. \\Myserver is a network...
2
by: Mike John | last post by:
I am trying to use the shell object to send keys to the explorer browser to run the send page funcion. I am receiving the above error only when I put my html file in the web server...
1
by: Dennis | last post by:
I use the below code to get the Network Places items. However, this requires "Late Binding". I read that you can avoid late binding by adding a reference to the Com Types in your application. ...
4
by: uinoma | last post by:
I want to open notepad in fullscreen mode, but this script that I created can't do that. . When I open Windows Manager Task, the program is just run in background, not appeared on web server...
1
by: yoram.ayalon | last post by:
Hello, we have this situation. web farm, several server 2003 machines, and several win2K, SP 4 machines all machines access files on a Network appliance using CIFS I am testing a ASP.NET...
3
by: radrain | last post by:
Unable to CreateObject("wscript.network") in IE7. This works fine in IE6 BUT this is now considered to be 'unsafe' and I cannot find any alternatives to getting the computer name and the UserDomain....
0
by: edurran | last post by:
Hi all, I have spent the last three days on this problem. Looked in many forums and not found the answer as yet. Hopefully ye can help. I have two functions. One works fine, the second does...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.