lundi 1 février 2016

Complicated Move Script

So to explain my question, here are my sample directories:

C:
  Source
    foldera1.1
      file1.1.txt
    foldera1.2
      file1.2.txt
    folder1.3
      file1.3.txt
  Destination
    foldera
      foldera1

I'm trying to write a script, be it powershell, batch, or VBS, that will move all the file1.x.txt files from the Source directory to the folder foldera1 in the Destination directory without creating 3 different move jobs and specifying ...folder1.1\file1.1.txt, ...folder1.2\file1.2.txt, etc. I am horrible at if/then statements and I'm unsure where I might be able to use wildcards if at all. Since I'm not able to put wildcards in a directory name when pointing to a file's path in a move or robocopy script, I'm at a loss as to where to go from here. Any help with this would be greatly appreciated.

Aucun commentaire:

Enregistrer un commentaire