Get Foldernames in Notepad

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
amitananddey
Posts: 14
Joined: 16 Jan 2012 04:56

Get Foldernames in Notepad

#1 Post by amitananddey » 26 Jun 2012 02:40

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*.

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Get Foldernames in Notepad

#2 Post by Squashman » 26 Jun 2012 07:08

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.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Get Foldernames in Notepad

#3 Post by foxidrive » 26 Jun 2012 10:02

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

Post Reply