Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch file help  (Read 2078 times)

0 Members and 1 Guest are viewing this topic.

soldier

  • Guest
Batch file help
« on: May 12, 2010, 11:31:06 AM »
Not sure if this is the right place to post this. But here goes.

I'll try and explain this as best as I could. I have a folder ( lets call it A) with a bunch of files in it. I wanted these files in a .txt file ( lets call it 1) so I made a batch file [dir /a /b /-p /o:gen >filelisting.txt]. So now I have the list of files from A, in this .txt file. ( 1 )

I'm going to create a subfolder in A ( lets call it B) to store some more files. What I want to do is, make another .txt file ( 2 ) with SOME file names from A and create a batch file to utilize that .txt ( 2 ) file and move those files from A, to B.

Was wondering if I could get some assitance please.

Salmon Trout

  • Guest
Re: Batch file help
« Reply #1 on: May 12, 2010, 03:37:10 PM »
You have a text file which is a list of the files you want to move. Let's call it files-to-be-moved.txt. How you get these filenames in that file is up to you.

You can use the batch command FOR to process the file and move the files.

for /f "delims=" %%A in (files-to-be-moved.txt) do move "%%A" B