Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Moving Folders base on their names using powershell

$
0
0

Hi there, I've reading some examples here which are not exactly what I need so I've been trying to adapt them with no luck. Sorry not a programmer here, but I need this done and don't know where to go.

The point is that I have 42.000 folders in a folders.

All the folders' names are numbers from 4 to 7 digits (which represents clients ID's)

They should be separated based on one list that I can put in a csv file.

In words my script should do this:

working path= d:\a (this is where the 42K folders are)

moving path= d:\a\movedfolders

list of folder to be moved= listtomove.csv

command:

read listtomove.csv

from beginning to end of listtomove.csv

compare first in list to all folders and

  if find a match then move to movedfoders

  if not read next value at listtomove.csv

next

exit:

voila... you just moved 22000 folders to the right place... lol (I don't need the count.)

Is this possible? if so: how?

Thanks for any help.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>