Can I get folders from a network share

I have Windows computers that have shares on them I would like to create a list of all the shared folders available.

I was trying this as a quick test to see if this is possible but the while loop doesn't run. The word "Processing" doesn't show in the log.

	var folderEnum = DOpus.FSUtil.ReadDir("\\\\Desktop\\");

		while (!folderEnum.complete) {
			var item = folderEnum.Next();
			DOpus.Output("name: " +;


Changing \\Desktop\ to \\Desktop\Nas does work, but requires me to know the names of all the shared folders.

*So my question is: Given a computer name in the form of "Desktop" how do I get a list of shares on that computer in jscript?

In Windows the root of a network server isn't a "real" folder, but you can use the shell to enumerate it by adding the "s" flag into the call to ReadDir:

var folderEnum = DOpus.FSUtil.ReadDir("\\\\Desktop\\", "s");

1 Like