1.

Solve : List Of Files With Batch?

Answer»

So Again Its Me

I Have Two Different Folders namely

E:\Test

and

E:\Temp

I want the Bath file to save name of files in both of folders in one text file
For ex The Text File Should be as Follows
Code: [Select]echo off
"file_in_Test_folder" "File_in_Temp_folder"

And If Possible it should also do
Code: [Select]echo off
COPY /Y "file_in_Test_folder" "File_in_Temp_folder"
You are MAD, joker!
You don't need a batch file to do that.
Just cut and past. Quote from: Geek-9pm on January 29, 2010, 11:49:33 PM

You are MAD, joker!
Thanks For The Compliment

Quote from: Geek-9pm on January 29, 2010, 11:49:33 PM
You don't need a batch file to do that.
Just cut and past.
U didnt understood my Problem 

There Is Not Only 1 File There are Several Files
 in both the folders

Once Again I WROTE MAD , COZ I AM Ha!Ha!Ha! You can do it by hand.
Making a Batch file wold be if you need to do it over and over again every day forever. If it is a report you need to make once a month, do it by hand,
You cget into the COMMAND prompt, CD to the directory you want. Give a DIR command. The you can do EDIT, MARK, COPY to get it to the clipboad. Noen Notepad. Paste and save. Do it again for the other directory.
If you need the files in two columns side by side, there is a norther step that does that. I THINK you can do that in Word.
This would work for up to about two or three hundred files in each directory.
If you have over three hundred files, then yes, you should do it in a batch program. Quote from: Geek-9pm on January 30, 2010, 01:33:11 PM
You can do it by hand.

I think he does... OFTEN!
Quote from: Salmon Trout on January 30, 2010, 05:30:15 PM
I think he does... often!
OH 

So he makes a batch file and takes a long lunch.

Hey! invite us for lunch if we write the batch  for you!
geek, if he wants to do it by hand, he would not post here in the first PLACE , would he?
OP , just do a dir on both directories and use redirection

Code: [Select]eg dir /B E:\tmp E:\test > newfile.txt
check dir /? for more options.GhostDog thanks for your help

but the file are coming like this

"Testfile1" (Temp Folder)
"Testfile1" (Test Folder)
......

I Want to get it like this

"Testfile1"  "Testfile2"

But I appreiciate your Help
 Are you making a list of files?
Do you want the files listed in two columns so you can compare thim?
Like this"
Code: [Select]
LIST OF FILES IN D:\test      LIST OF FILES IN D:\temp

D:\test\Sample-001            D:\temp\Sample-001
D:\test\Sample-002            D:\temp\Sample-002       
D:\test\Sample-003            D:\temp\Sample-003


How much information in the list? Is then for a report that will be printed later?
Is the purpose to compare the contents of both directories to see if a file is missing?
Geek You are the Best! 

D:\test\Sample-001            D:\temp\Sample-001
D:\test\Sample-002            D:\temp\Sample-002       
D:\test\Sample-003            D:\temp\Sample-003

example you gave is right...

but the space between them should be just "one"

like this
"D:\test\Sample-001" "D:\temp\Sample-001"
"D:\test\Sample-002" "D:\temp\Sample-002"     
"D:\test\Sample-003" "D:\temp\Sample-003"
Quote from: the_mad_joker on January 30, 2010, 11:59:27 PM

but the space between them should be just "one"


Why?
For me, i can not do it all in batch, but inside of dos. i will need the old dos QBASIC.
Quote
Here is the batch:
DIR D:\test\*.* > LListA.txt
DIR D:\temp\*.* > ListB.txt
QBASIC /RUN ListAB2C.BAS
The ABASIC program ListAB2C.BAS
Quote
OPEN "LISTA.TXT" FOR INPUT AS #1
OPEN "LISTB.TXT" FOR INPUT AS #2
OPEN "LISTC.TXT" FOR OUTPUT AS #3
Q$=CHR$(34)
WHILE NOT EOF(1)
  LINE INPUT #1, A$
  LINE INPUT #1, B$
  PRINT #3, Q$ ; A$ ; Q$ ; " " ;Q$ ; B$ ; Q$
WEND
SYSTEM

EDIT. fixed typos. Quote from: Salmon Trout on January 31, 2010, 01:03:10 AM
Why?


So That There could be more data in one line Quote from: the_mad_joker on January 31, 2010, 01:15:51 AM
So That There could be more data in one line

But, like a piece of string, a line can be any length.


Discussion

No Comment Found