Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Other Programming > VBScript
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 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
Default 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
%>

Reply With Quote
  #2 (permalink)  
Old December 21st, 2004, 08:32 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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
Reply With Quote
  #3 (permalink)  
Old December 21st, 2004, 08:56 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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
Reply With Quote
  #4 (permalink)  
Old 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
Default

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.....

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to upload folder from client to server hemaneelagiri ASP.NET 1.0 and 1.1 Professional 2 July 18th, 2007 06:10 AM
How to create a folder in server and rename files pramos.21d ASP.NET 2.0 Basics 0 April 24th, 2006 05:27 AM
Creating Folder On Server Prabhakar_dt Classic ASP Basics 1 December 29th, 2004 05:07 AM
login domain account and view a permission folder cslimcom Classic ASP Databases 0 December 22nd, 2004 10:24 PM
view server folder problem? cslimcom Classic ASP Databases 4 December 21st, 2004 10:08 PM



All times are GMT -4. The time now is 07:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.