Solved

Print filename to notepada

Posted on 2003-11-20
9
224 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

734 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