Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Server.CreateObject("Scripting.FileSystemObject") on another serve

Reply
Thread Tools

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

 
 
Todd
Guest
Posts: n/a
 
      07-17-2007
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

 
Reply With Quote
 
 
 
 
Todd
Guest
Posts: n/a
 
      07-18-2007


"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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot get my computer to serve a shared folder =?Utf-8?B?U3ViWE8=?= Wireless Networking 0 08-30-2005 02:10 AM
Will an ActiveX control serve this purpose? Shawn ASP .Net 2 06-24-2005 12:48 PM
is there problem to work with vs.net on web application and also to the iis to serve web clients ? Patrice ASP .Net 3 04-18-2005 05:14 PM
The web serve has been locked down and is blocking the Debug verb. =?Utf-8?B?UmV6YSBTb2xvdWtp?= ASP .Net 3 11-24-2004 11:25 PM
Serve ASP.NET control through custom RequestHandler Ricky K. Rasmussen ASP .Net 3 06-07-2004 01:59 PM



Advertisments