Solved

Print filename to notepada

Posted on 2003-11-20
9
225 Views
Last Modified: 2010-05-01
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
Comment
Question by:bram_code
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 30 total points
ID: 9786123
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
 
LVL 28

Assisted Solution

by:vinnyd79
vinnyd79 earned 20 total points
ID: 9786863

Private Sub Command1_Click()
Shell Environ("Comspec") & " /c dir /b C:\Music\*.mid > C:\MyList.txt", vbHide
End Sub
0
 
LVL 3

Expert Comment

by:ToolMan
ID: 9787087
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:TooKoolKris
ID: 9787190
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
 
LVL 28

Expert Comment

by:vinnyd79
ID: 9787219
>>  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
 
LVL 9

Expert Comment

by:TooKoolKris
ID: 9787833
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
 
LVL 28

Expert Comment

by:vinnyd79
ID: 9787941
"thourough" should be "thorough"
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 9787942
Word spellchecker set to English(United Kingdom) prefers 'thorough' to 'thourough'.
0
 
LVL 9

Expert Comment

by:TooKoolKris
ID: 9789792
lol
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question