• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

Print filename to notepada

Hello experts, i have more than two thousands midi file in my C:\music directory, now i am copying down the file name one by one which i think a very time-consuming work, any idea how to copy the file name and paste into notepad? thank you
0
bram_code
Asked:
bram_code
  • 3
  • 3
  • 2
  • +1
2 Solutions
 
GrahamSkanRetiredCommented:
This should compose a list for you

Dim FileName as string
Dim f as Integer
f = Freefile
Open "MyMidiList.txt" for output as #f
FileName = Dir$("C:\music directory\*.mid")
Do Until FileName = ""
Print #f, FileName
FileName = Dir$()
Loop
Close #f
0
 
vinnyd79Commented:

Private Sub Command1_Click()
Shell Environ("Comspec") & " /c dir /b C:\Music\*.mid > C:\MyList.txt", vbHide
End Sub
0
 
ToolManCommented:
Hi,
the easiest way to put all the filenames to a textfile would be just typing the dos command what vinnyd79 wrote into a dosshell and you are ready

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
TooKoolKrisCommented:
You don't need a script to do this.

Just go to a DOS prompt and type the following once you move to the C:\music directory

C:\music>dir > text.txt

This will send the output of typing the dir command straight into a text file that it drops on the root of the C: drive.
You can then open it in notepad and edit.
0
 
vinnyd79Commented:
>>  Just go to a DOS prompt and type the following

Why type it when you can just press a button instead?

Also if you are in the music directory and specify just a filename without a path,it will put it in the Music directory and not the root of C:
Also,you need to specify the /b switch to get just the filenames.
0
 
TooKoolKrisCommented:
Gee did you run my post through the spellchecker as well to make sure I don't have any mistakes with my spelling? You should be thourough you know.
0
 
vinnyd79Commented:
"thourough" should be "thorough"
0
 
GrahamSkanRetiredCommented:
Word spellchecker set to English(United Kingdom) prefers 'thorough' to 'thourough'.
0
 
TooKoolKrisCommented:
lol
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now