That is: find all subdirectories of current directory; for each subdirectory, find all files, and print file count and path. Finally it sorts the result to show folders with most files on top
Note that the first entry is the folder itself. Also this script omits soft links and does not count sub-folders as files.

Enter the Application Name, agree to the Terms of Service, and click Create Application button.

On Edit Application page, which will be opened after application is created (or can be opened by choosing Edit Settings on My Applications page, while application you want to edit is selected), go to Canvas tab.

In Canvas Page URL, specify the URL, on which application will be available inside Facebook.

Go to your hosted space and create a “default” page (e.g. default.htm or index.html, depending on hosting service) with the authentication code described on Authentication Page, Single Sign-on with the JavaScript SDK section. The values for FACEBOOK_APP_ID and FACEBOOK_SECRET have to be replaced with values that can be found on Basic tab of Edit Application Page.

Now try to access your application via Facebook Canvas Page URL. You should get the “Logged out” page at first, with option to login. Once you login, you should see a “User ID”. This application doesn’t do anything, but this is your first app! You can add a “Hello, world!” line to it too, if you wish.

Different ways to accomplish this are described in Microsoft KB article #321686. If importing is not recurring, or persistent connection is not possible, it makes sense to use Distributed Query. Running such query in SQL Server Management Studio of SQL Server 2005 will, however, produce the following error:

SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.

It can be resolved by enabling “advanced options” and “Ad Hoc distributed Queries” option, executing query to import data, and (optionally) reverting the configuration to its original state: