473,387 Members | 1,528 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,387 software developers and data experts.

Server.CreateObject("Scripting.FileSystemObject") on another serve

trying to access files located on another server within the network. the
folder is shared out and we created a virtual directory as well.
The error is Microsoft VBScript runtime error '800a004c' Path not found

Here is my code

<%

dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject ")
set fo=fs.GetFolder("\\hostname\procedures")

for each x in fo.files
'Print the name of all files in the test folder
Response.write(x.Name & "<br />")
next
set fo=nothing
set fs=nothing
%>

....tried some MS solutions

http://support.microsoft.com/default...;en-us;Q197964

and

http://databases.aspfaq.com/database...er-server.html

The previous was from a post on this page from May 2007.

Thank You in advance for any help you might provide

Jul 17 '07 #1
3 7612


"Jon Paal [MSMD]" wrote:
http://forum.echoechoplus.com/showth...?threadid=7948
this may help
I've tried the WshNetwork route...still cant' get a successful connection
but I'm getting other error messages which suggest to me that at least it can
see the map.

I've been trying different drive letters usernames, passwords etc to try and
get a successful hookup.

However, when I run the code now it knocks out my IIS (or so it
appears)......I have to go and reboot the webserver. Wondering whats causing
that. Heres the script

Set WshShell = server.CreateObject("WScript.Shell")
Set WshNetwork = server.CreateObject("WScript.Network")
Set CheckDrive = WshNetwork.EnumNetworkDrives()
AlreadyConnected = False
DriveLetter = "P:" 'DriveLetter must be a CAPITAL letter
RemotePath = "\\server\sharedfolder"
username = "domainname\username"
pass = "password"
choice = "false"
if CheckDrive.count 0 then
For i = 0 To CheckDrive.Count - 1
If CheckDrive.Item(i) = DriveLetter Then AlreadyConnected = True
Next

If AlreadyConnected = True then
WshNetwork.RemoveNetworkDrive DriveLetter
WshNetwork.MapNetworkDrive DriveLetter, RemotePath, choice, username, pass
WshShell.PopUp "Drive " & DriveLetter & "Disconnected, then connected
successfully."

Else
WshNetwork.MapNetworkDrive DriveLetter, RemotePath, choice, username, pass
WshShell.PopUp "Drive " & DriveLetter & " connected successfully."

End if

else
WshNetwork.MapNetworkDrive DriveLetter, RemotePath, choice, username, pass
***this is where is hangs***
WshShell.PopUp "Drive " & DriveLetter & " connected successfully."

end if
Thank You for your assistance

Jul 18 '07 #3
you may need to try wsh questions here:

microsoft.public.scripting.wsh
Jul 19 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lin Ma | last post by:
Greetings, Is it possbile to check a file exist without using Server.CreateObject("Scripting.FileSystemObject") in asp page?? The reason is our hosting company turn that function off for...
5
by: Andrew | last post by:
Hi, experts, My system has a problem when I invoke the fileSystemObject to create a text file (it worked ok long before.) The asp seems running, but actually never finishes. I don't know what I...
3
by: bt | last post by:
I am just beginning with asp and have gotten an error that I need some help with. I posted a pair of files to an online ASP host server. The files are in the same directory; one is readfile.asp...
2
by: Stavros | last post by:
Hi all when I execute the following VB6 code in Windows 2000 and as an Administrator, everything is working fine. Project->References->"Microsoft Scripting Runtime" and scrrun.dll is located...
4
by: MoF | last post by:
Hello! I have for a long time used the line: Set FS=Server.CreateObject("Scripting.FileSystemObject") in my ASP code. Suddenly one day this week it stopped working and I now get the error: ...
1
by: chsmith | last post by:
I'm calling a .net / c# .dll from .ASP via Server.CreateObject(). I regasm, gacutil /i and all runs fine on XP SP1 or older. SP2 registry subracts System (??) from the registry root nodes and...
0
by: hellind | last post by:
When the form is submitted as ENCTYPE="multipart/form-data" using AspUpload component, I understand to use Upload.form("") to retreive the form elements. But I cannot retreive it from inside a class....
5
by: Barry | last post by:
I've wasted the whole day trying things and researching, but nothing is working. I would *greatly* appreciate if someone can give me the solution to this problem. I'm using the .NET Framework...
7
by: Benjamins via AccessMonster.com | last post by:
Hi, I have meet a problem for CreateObject("Scripting.FileSystemObject"). I uses this code to get the information of the harddisk I have 10 user using the same code. All where working fine...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.