Solved

Print filename to notepada

Posted on 2003-11-20
9
219 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
  • 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now