Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read Client Side Folder ?

Status
Not open for further replies.

TWillard

Programmer
Apr 26, 2001
263
US
I have an asp page that I would like to have read the folder structure on a client machine. I am creating icons on my web page based on certain software programs currently installed on the users' mahines. Is it possible to do this with ASP?
 
Hey TWillard,

Since ASP is server side only, you will have to use VBSCRIPT to accomplish this. Just use the regular FileSystemObject to run through the files and folders.

Cheers,

Gorkem.
 
Yes, I would like to use the FileSystemObject, but the FSO reads folders off of the server machine. How do I get it to interact with the client machine via asp pages?
 
put your code between:

<script language=&quot;VBSCRIPT&quot;>


</SCRIPT>

tags..


ie:

<script language=&quot;VBSCRIPT&quot;>
set fs = createobject(&quot;scripting.filesystemobject&quot;)
...
...
etc
...
</SCRIPT>

 
I am getting a vbscript error:

Active X component can not create object 'scripting.filesystemobject'

Here is my code

<script language=&quot;VBSCRIPT&quot;>

Dim objFSO
set objfso = createobject(&quot;scripting.filesystemobject&quot;)

'Get the folder object associated with the directory
Dim objFolder
Set objFolder = objFSO.GetFolder(&quot;C:\InetPub\
Response.Write &quot;The files found in &quot; & objFolder.Name & &quot;:<br>&quot;

'Loop through the Files collection
Dim objFile
For Each objFile in objFolder.Files
Response.Write objFile.Name & &quot;<br>&quot;
Next

'Clean up!
Set objFolder = Nothing
Set objFile = Nothing
Set objFSO = Nothing

</SCRIPT>
 
You Need to Enable

&quot;Initialiase and Script ActiveX Controls Not Marked as Safe&quot; in your IE Security Settings.

Tools >> Internet Options >> Security



Codefish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top