Solved

Print filename to notepada

Posted on 2003-11-20
9
222 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to open Waze.com/livemap from address saved in DB? 26 189
passing parameter in sql procedure 9 63
RUNRMTCMD from AS/400 12 47
Send outlook email from VBS Script 2 30
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

778 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