Page 1 of 1

Get Foldernames in Notepad

Posted: 26 Jun 2012 02:40
by amitananddey
Hi Members,
Is it possible to copy only folder names to notepad by prefix..

Currently I am using this
dir/a /b /-p /o:gen >FileList.txt
The above code copies all the folder names to a textfile.

suppose I have a folder like this
--AOapplle
--AOBaby
--COCar

Wat if instead of getting all the folder names,is it possible to get folder names only for AO*.

Re: Get Foldernames in Notepad

Posted: 26 Jun 2012 07:08
by Squashman
So what is stopping you from using that search mask with the DIR command?
You may want to change your attributes to /ad to make sure it only lists directories.

Re: Get Foldernames in Notepad

Posted: 26 Jun 2012 10:02
by foxidrive
And in a batch file this will include ao* folders

file.bat ao*

Code: Select all

@echo off
dir "%~1" /a:d /b /-p /o:gen >FileList.txt
start notepad filelist.txt