1.

Solve : create a list of files?

Answer»

Folder InPut on desktop is having 3 files..   

File 1.doc
File 2.doc
File 3.doc

Now I want to create a batch file on desktop which CREATES list of all files as file.txt on desktop

So file.txt should contain...

File 1.doc
File 2.doc
File 3.doc

Please help (needed only short names) CODE: [Select]echo off
chdir %userprofile%\Desktop\InPut
dir >..\File.txt
exit
Quote from: bobsklarservices on October 21, 2011, 09:26:08 AM

Code: [Select]echo off
chdir %userprofile%\Desktop\InPut
dir >..\File.txt
exit

That will give you a full directory output, but I don't think that is what the OP is looking for. Try adding /b the dir command to shorten things up. Also, not all batchers are going to know where "..\File.txt" is going to show up, so make it a little more obvious:

dir /b > %userprofile%\desktop\File.txt Quote from: Raven19528 on October 24, 2011, 10:56:39 AM
not all batchers are going to know where "..\File.txt" is going to show up

They will soon (if they are the sort who are worth helping!) and especially if you tell them that two DOTS and a slash like this ..\ means "the directory one level up from where you are" and that you can stack them to go all the way up the tree.
I knew exactly what the code I posted would do. But thank you for clarifying it for me. While I may be pretty INTELLIGENT, I don't necessarily communicate WELL.


Discussion

No Comment Found