On a shared drive there is a directory "Q:\batch_Rxaoutput" inside that directory there are over a thousand directories for example "Q:\batch_Rxaoutput\SUNY" or "Q:\batch_Rxaoutput\PDFL". The subdirectory within "Q:\batch_Rxaoutput" contains only four letter codes where monthly reports are outputted by an SSIS package. Sometimes a report needs to re-ran due to errors so there are multiple reports created within one of the thousand or so output locations. My goal is to loop through each folder insided "Q:\batch_Rxaoutput" and move the folders, subfolders and files contain the same name.
For example in Q:\Batch_Rxaoutput\EEKY there is:
Q:\Batch_Rxaoutput\EEKY\Dec2014_20150108044150
Q:\Batch_Rxaoutput\EEKY\Dec2014_20150114090454
Q:\Batch_Rxaoutput\EEKY\Dec2014_20150115094531
Q:\Batch_Rxaoutput\EEKY\Feb2015_20150302122307
Q:\Batch_Rxaoutput\EEKY\Jan2015_20150202214348
Q:\Batch_Rxaoutput\EEKY\Jan2015_20150214223734
I want to to move only the no current folders,subfolders and files.
the monthly folder names are Month.year_year.month.hours(military).hours.seconds.milliseconds
So basically if there are multiple folder names Feb2015_* or Jan2015* move the ones that have the lowest numeric value after the underscore.
I would love to accomplish this from a .bat cmd if possible.
Please let me know if there is more info that would help!
Related
I wanted to ask for some help to extract a few things.
I have more or less 2TB of files that are zipped, and I want to unzip the .txt files and that inside that .txt file it says "Função: finalizar vendas"
There are several .rar .zip .7z files that have inside them several folders with the names of the employees, and inside the folders their respective functions, which would be inside some of the notepads.
The only thing I managed to get closer to this was in 7-Zip, with a command to extract only the .txt files from the compact files, but there are many unnecessary notepads and I just wanted the one that contains the previously said sentence.
Since I do not have a lot of experience in coding batch files, I would like to ask for some helping hands.
There are multiple files in the source folder. The files list is like this.
ABCD_CH_DEFGH.XLS
ABCD_CH_DEFGH.PDF
ABCD_CH_DEFGH_001_001.XLS
ABCD_CH_DEFGH_001_001.PDF
QWER_DE_OPESADHXCS_002_002.XLS
QWER_DE_OPESADHXCS_002_002.PDF
I would need a batch file which iterates through the files in the source folder and moves only files with the substring _xxx_xxx. to an existing subfolder which are in this case:
ABCD_CH_DEFGH_001_001.XLS
ABCD_CH_DEFGH_001_001.PDF
QWER_DE_OPESADHXCS_002_002.XLS
QWER_DE_OPESADHXCS_002_002.PDF
Please can someone help with the below
I have two folders:
C:\FolderA
C:\FolderB
Folder A contains a bunch of files like an archive
Folder B contains the same bunch of files with the same name, however some data within the files may be different.
I want to write a .bat file which uses the diff command to compare all the files from folder A to the files in folder B with the corresponding name (e.g. update0001 against update 0001) and outputs the difference in "C:\Folder C" with each file difference in a separate text output. (e.g one file is called “Error update0001” and another “Error Update0005”
This is a simple way to check the files in two folders and give results.
fc /b "c:\folder a\*.*" "c:\folder b\*.*" >"c:\folder c\results.txt"
I am new in windows batch scripting and would like to ask the following question:
Suppose I have "xyz" folder which contains several other subfolders. Now I want to loop through these subfolders and if any of them has a specific name (say "abc") then I would rename it with current date (like "abc_ddmmyy") and store it to some other folder.
How this can be done using a MS-DOS batch file?
would anyone know how to write a batch file (or two) that would:
copy hundreds of "index.html" files that are in different folders and keep within the same folder (so needs to search within sub folders)
rename the copies (keep the originals as is) to "index.jpg"
could anyone help?
I used a bulk rename tool to rename all index.html files to index.jpg in a copy of the main folder, then used robocopy to copy everything over, including the file structure back to the original folder (leaving the index.html's alone)