Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Contents of a Directory

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  IIS Password Protected Directory 403 Errors on PH..  
Author Message
user3239

External


Since: Dec 01, 2004
Posts: 15



(Msg. 1) Posted: Wed Dec 01, 2004 3:57 pm
Post subject: Contents of a Directory
Archived from groups: microsoft>public>inetserver>iis (more info?)

Hello,

Is there a system call or function that "gets the contents of a directory"?
Identical to doing a "dir" or "ls" from the command line.

This is for windows 2003 IIS 6.0. I've searched throughout the help index
with no luck. Thanks.

 >> Stay informed about: Contents of a Directory 
Back to top
Login to vote
user641

External


Since: Aug 22, 2003
Posts: 1637



(Msg. 2) Posted: Wed Dec 01, 2004 4:07 pm
Post subject: Re: Contents of a Directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Steven Livolsi" <steven.livolsi RemoveThis @ngc.com> wrote in message
news:u53qih#1EHA.2012@TK2MSFTNGP15.phx.gbl...
 > Is there a system call or function that "gets the contents of a
directory"?
 > Identical to doing a "dir" or "ls" from the command line.
 >
 > This is for windows 2003 IIS 6.0. I've searched throughout the help index
 > with no luck. Thanks.

How would you be using it?<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Contents of a Directory 
Back to top
Login to vote
user3239

External


Since: Dec 01, 2004
Posts: 15



(Msg. 3) Posted: Wed Dec 01, 2004 4:36 pm
Post subject: Re: Contents of a Directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In a dll.

Thanks.

"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:%23jwoWn%231EHA.2708@TK2MSFTNGP10.phx.gbl...
 > "Steven Livolsi" <steven.livolsi.DeleteThis@ngc.com> wrote in message
 > news:u53qih#1EHA.2012@TK2MSFTNGP15.phx.gbl...
  > > Is there a system call or function that "gets the contents of a
 > directory"?
  > > Identical to doing a "dir" or "ls" from the command line.
  > >
  > > This is for windows 2003 IIS 6.0. I've searched throughout the help
index
  > > with no luck. Thanks.
 >
 > How would you be using it?
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Contents of a Directory 
Back to top
Login to vote
user3239

External


Since: Dec 01, 2004
Posts: 15



(Msg. 4) Posted: Wed Dec 01, 2004 4:39 pm
Post subject: Re: Contents of a Directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Maybe I wasn't clear. All I want is to get the directory names and file
names that are contained in a specified directory path.

A filename.dll will be executing this code.

Thanks.

"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:%23jwoWn%231EHA.2708@TK2MSFTNGP10.phx.gbl...
 > "Steven Livolsi" <steven.livolsi.RemoveThis@ngc.com> wrote in message
 > news:u53qih#1EHA.2012@TK2MSFTNGP15.phx.gbl...
  > > Is there a system call or function that "gets the contents of a
 > directory"?
  > > Identical to doing a "dir" or "ls" from the command line.
  > >
  > > This is for windows 2003 IIS 6.0. I've searched throughout the help
index
  > > with no luck. Thanks.
 >
 > How would you be using it?
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Contents of a Directory 
Back to top
Login to vote
user641

External


Since: Aug 22, 2003
Posts: 1637



(Msg. 5) Posted: Wed Dec 01, 2004 5:09 pm
Post subject: Re: Contents of a Directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Steven Livolsi" <steven.livolsi.RemoveThis@ngc.com> wrote in message
news:Ow0V54#1EHA.1860@TK2MSFTNGP15.phx.gbl...
 > Maybe I wasn't clear. All I want is to get the directory names and file
 > names that are contained in a specified directory path.
 >
 > A filename.dll will be executing this code.

Depends on what language/tool you're using. Most of the time you can
reference the COM based filesystemobject:
<a style='text-decoration: underline;' href="http://msdn.microsoft.com/library/en-us/script56/html/FSOoriFileSystemObject.asp" target="_blank">http://msdn.microsoft.com/library/en-us/script56/html/FSOoriFileSystemObject.asp</a>

Here's a reference to the Platform SDK:
<a style='text-decoration: underline;' href="http://msdn.microsoft.com/library/en-us/fileio/base/listing_the_files_in_a_directory.asp" target="_blank">http://msdn.microsoft.com/library/en-us/fileio/base/listing_the_files_...a_direc</a>

If you're using dot net, see the System.IO classes:
<a style='text-decoration: underline;' href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemIO.asp" target="_blank">http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemIO.asp</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Contents of a Directory 
Back to top
Login to vote
user1772

External


Since: Jun 10, 2004
Posts: 1807



(Msg. 6) Posted: Thu Dec 02, 2004 8:35 am
Post subject: Re: Contents of a Directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 1 Dec 2004 15:57:27 -0500, "Steven Livolsi"
<steven.livolsi DeleteThis @ngc.com> wrote:

 >Is there a system call or function that "gets the contents of a directory"?
 >Identical to doing a "dir" or "ls" from the command line.
 >
 >This is for windows 2003 IIS 6.0. I've searched throughout the help index
 >with no luck. Thanks.

VBScript has the FileSystem Object that will do this.

Jeff<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Contents of a Directory 
Back to top
Login to vote
user3239

External


Since: Dec 01, 2004
Posts: 15



(Msg. 7) Posted: Thu Dec 02, 2004 12:14 pm
Post subject: Re: Contents of a Directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks.

I tried using the File System Objects in my java scipt but it looks like
the java script code bombed.

It bombed on the statement:

fso = new ActiveXObject("Scripting.FileSystemObject");

If I comment out the above statement, my java script function does not bomb.

Is there a setting or something I need to do with my windows 2003 IIS sever?
Is there an include file I need?

My java script is:

<script language=javascript>

function select_change()
{
..
..
..
var fso;
fso = new ActiveXObject("Scripting.FileSystemObject");
..
..
..
}

</script>

Here's part
"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:%23HvzBK$1EHA.3324@tk2msftngp13.phx.gbl...
 > "Steven Livolsi" <steven.livolsi RemoveThis @ngc.com> wrote in message
 > news:Ow0V54#1EHA.1860@TK2MSFTNGP15.phx.gbl...
  > > Maybe I wasn't clear. All I want is to get the directory names and file
  > > names that are contained in a specified directory path.
  > >
  > > A filename.dll will be executing this code.
 >
 > Depends on what language/tool you're using. Most of the time you can
 > reference the COM based filesystemobject:
 >
<a style='text-decoration: underline;' href="http://msdn.microsoft.com/library/en-us/script56/html/FSOoriFileSystemObject.asp" target="_blank">http://msdn.microsoft.com/library/en-us/script56/html/FSOoriFileSystemObject.asp</a>
 >
 > Here's a reference to the Platform SDK:
 >
<a style='text-decoration: underline;' href="http://msdn.microsoft.com/library/en-us/fileio/base/listing_the_files_in_a_directory.asp" target="_blank">http://msdn.microsoft.com/library/en-us/fileio/base/listing_the_files_...a_direc</a>
 >
 > If you're using dot net, see the System.IO classes:
<font color=purple> > <a style='text-decoration: underline;' href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemIO.asp</font" target="_blank">http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemIO.asp</font</a>>
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Contents of a Directory 
Back to top
Login to vote
user641

External


Since: Aug 22, 2003
Posts: 1637



(Msg. 8) Posted: Thu Dec 02, 2004 2:34 pm
Post subject: Re: Contents of a Directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Steven Livolsi" <steven.livolsi.DeleteThis@ngc.com> wrote in message
news:O6HEqJJ2EHA.204@TK2MSFTNGP10.phx.gbl...
 > Thanks.
 >
 > I tried using the File System Objects in my java scipt but it looks like
 > the java script code bombed.
 >
 > It bombed on the statement:
 >
 > fso = new ActiveXObject("Scripting.FileSystemObject");
 >
 > If I comment out the above statement, my java script function does not
bomb.
 >
 > Is there a setting or something I need to do with my windows 2003 IIS
sever?
 > Is there an include file I need?
 >
 > My java script is:
 >
 > <script language=javascript>
 >
 > function select_change()
 > {
 > .
 > .
 > .
 > var fso;
 > fso = new ActiveXObject("Scripting.FileSystemObject");
 > .
 > .
 > .
 > }
 >
 > </script>
 >

You're trying to run this client-side? You can't use the FileSystemObject
in client-side browser code as that would be a security breach. You would
have to wrap it in a custom ActiveX and sign it.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Contents of a Directory 
Back to top
Login to vote
user3239

External


Since: Dec 01, 2004
Posts: 15



(Msg. 9) Posted: Thu Dec 02, 2004 3:56 pm
Post subject: Re: Contents of a Directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks.

I think I see what you mean. However, I don't understand when you say "wrap
it in a custom Active X and sign it". Could you please explain?

Also, the code listed below I thought could be run in java script. (Client
and Server)

Scripting Runtime Library

Folders Collection
Collection of all Folder objects contained within a Folder object.

Remarks
The following example illustrates how to get a Folders collection and how to
iterate the collection:

[JScript]
function ShowFolderList(folderspec)
{
var fso, f, fc, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder(folderspec);
fc = new Enumerator(f.SubFolders);
s = "";
for (; !fc.atEnd(); fc.moveNext())
{
s += fc.item();
s += "<br>";
}
return(s);
}
Thanks."Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:O9LWNYK2EHA.3640@tk2msftngp13.phx.gbl...
 > "Steven Livolsi" <steven.livolsi RemoveThis @ngc.com> wrote in message
 > news:O6HEqJJ2EHA.204@TK2MSFTNGP10.phx.gbl...
  > > Thanks.
  > >
  > > I tried using the File System Objects in my java scipt but it looks
like
  > > the java script code bombed.
  > >
  > > It bombed on the statement:
  > >
  > > fso = new ActiveXObject("Scripting.FileSystemObject");
  > >
  > > If I comment out the above statement, my java script function does not
 > bomb.
  > >
  > > Is there a setting or something I need to do with my windows 2003 IIS
 > sever?
  > > Is there an include file I need?
  > >
  > > My java script is:
  > >
  > > <script language=javascript>
  > >
  > > function select_change()
  > > {
  > > .
  > > .
  > > .
  > > var fso;
  > > fso = new ActiveXObject("Scripting.FileSystemObject");
  > > .
  > > .
  > > .
  > > }
  > >
  > > </script>
  > >
 >
 > You're trying to run this client-side? You can't use the FileSystemObject
 > in client-side browser code as that would be a security breach. You would
 > have to wrap it in a custom ActiveX and sign it.
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Contents of a Directory 
Back to top
Login to vote
user1772

External


Since: Jun 10, 2004
Posts: 1807



(Msg. 10) Posted: Thu Dec 02, 2004 4:35 pm
Post subject: Re: Contents of a Directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 >I tried using the File System Objects in my java scipt but it looks like
 >the java script code bombed.

I didn't think Javascript had a File System Object. It's a VBScript
object:

<a style='text-decoration: underline;' href="http://www.devguru.com/Technologies/vbscript/quickref/filesystemobject.html" target="_blank">http://www.devguru.com/Technologies/vbscript/quickref/filesystemobject.html</a>

Jeff<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Contents of a Directory 
Back to top
Login to vote
user3239

External


Since: Dec 01, 2004
Posts: 15



(Msg. 11) Posted: Thu Dec 02, 2004 4:35 pm
Post subject: Re: Contents of a Directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks.

I found this for javascript:

Scripting Runtime Library

Folders Collection
Collection of all Folder objects contained within a Folder object.

Remarks
The following example illustrates how to get a Folders collection and how to
iterate the collection:

[JScript]
function ShowFolderList(folderspec)
{
var fso, f, fc, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder(folderspec);
fc = new Enumerator(f.SubFolders);
s = "";
for (; !fc.atEnd(); fc.moveNext())
{
s += fc.item();
s += "<br>";
}
return(s);
}
"Jeff Cochran" <jeff.nospam RemoveThis @zina.com> wrote in message
news:41b07b40.361671255@msnews.microsoft.com...
  > >I tried using the File System Objects in my java scipt but it looks like
  > >the java script code bombed.
 >
 > I didn't think Javascript had a File System Object. It's a VBScript
 > object:
 >
 >
<a style='text-decoration: underline;' href="http://www.devguru.com/Technologies/vbscript/quickref/filesystemobject.html" target="_blank">http://www.devguru.com/Technologies/vbscript/quickref/filesystemobject.html</a>
 >
 > Jeff<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Contents of a Directory 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]