Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Batch code to read, then move files from one folder to another


27 Sep 2011   #1

Windows 7 Professional x64
 
 
Batch code to read, then move files from one folder to another

I'm new to batch coding, so I was hoping someone could help me out. I need to read several .txt files and search them for a specific string, lets say "key1" and "key2." If the file has key1, then it needs to be moved into directory1. If the file has key2, then it needs to be moved to directory2. There's no telling ahead of time what line the string is going to be on, so I'm guessing I could use "Find" to search for the key? Then how do I loop through all the files, read them, then sort them into the different directories?
Any help is much appreciated!

My System SpecsSystem Spec
.

28 Sep 2011   #2

Windows 7 Ultimate x64
 
 

I think that might be easier to do with a PowerShell script, though I'm no help on either of these subjects, I'm afraid.

Have a quick Google/Bing around for PowerShell scripting - I wouldn't imagine this is very difficult for beginners (the scripting, not Googling )
My System SpecsSystem Spec
Reply

 Batch code to read, then move files from one folder to another




Thread Tools



Similar help and support threads for: Batch code to read, then move files from one folder to another
Thread Forum
Finding numerous files in a folder using a batch Software
Solved Batch File to Move a list of files. General Discussion
Temp folder getting filled with batch files General Discussion
Trying to use batch code to parse and archive log files... Errors... Software
Batch file to move (many) duplicted folder contents - Help!! General Discussion
Copy or move files using right click reg code General Discussion
Batch file for moving files to folder? General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 04:01 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33