|
 |
VBScript For questions and discussions related to VBScript. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |

December 21st, 2004, 02:48 AM
|
Registered User
|
|
Join Date: Dec 2004
Location: alor setar, kedah, Malaysia.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
how to view server folder ?
hi, all member ....
i have 2 server.......
first server is 192.168.0.10
second server is 192.168.0.57
my code inside first server..
but i want access all share folder in second server......
so, how a step i must do to fully access folder....
after run code like below, "path no found" error message display???
my code have any problem?
<%
Dim fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Dim rootFolder
Set rootFolder = fso.GetFolder("\\192.168.0.57")
Dim subFolders
Set subFolders = rootFolder.SubFolders
For Each folder in subFolders
response.write "<form action='showfolder.asp' method='post'>"
Response.Write folder.Name
Response.write "</form>"
Next
Set subFolders = Nothing
Set rootFolder = Nothing
Set fso = Nothing
%>
|

December 21st, 2004, 08:32 AM
|
Friend of Wrox
|
|
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
You are using UNC syntax, so try the actual server name instead of its IP address:
'====================================
Set rootFolder = fso.GetFolder("\\ServerName\ShareName")
'====================================
In your current statement, there is no Path specified. Using ServerName and ShareName will get your path.
mmcdonal
|

December 21st, 2004, 08:56 AM
|
Friend of Wrox
|
|
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
Hi,
It occurs to me that you may have security issues with this remote access. Try mapping the drive, getting data, and unmapping like this:
'===============================
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "x:", "\\ServerName\ShareName", _
strUserName, strPassword
'your code here
objNetwork.RemoveNetworkDrive "x:"
'===============================
This will allow you to access the drive with the credentials you need if your users don't have the proper credentials.
mmcdonal
|

December 21st, 2004, 10:20 PM
|
Registered User
|
|
Join Date: Dec 2004
Location: alor setar, kedah, Malaysia.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thank mmcdonal,
i just a beginning programmer...
can u teach me a step by step....
here, i want view all share folder for 192.168.0.57(server address)
how to i solve it.....
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |