Search This Blog

Tuesday, December 11, 2012

Get The File Names From A Folder

Ok, when some DOS gurus see this post, they might laugh. But for me, in one of the projects, this was a real life saver and a value add to the client.

So the tip - It is not the quantity of the code which creates value; but, how it is being used :)
Like the saying: Even a grass can be a good tool at the right time.

The command is this: DIR /B /ON *.* > MyMusicList.txt

The example here, is the requirement to get the list of the file names in my music folder, to share with a friend, so that he can select the ones he like.


So first I went to the root folder where I have kept all music collections.And then fired the command and gave a target file name.

Then I can see the file MyMusicList.txt generated under the same path where I have kept the music files, which has all the music file names exported.




Now the real power is not getting some music files. But how to use it for adding value to any application we work on.

What if there are files in the PeopleSoft file server that need to be accessible to the client online? There you go.

No comments:

Post a Comment