Write a file replacement powershell or batch script to replace undesirable files with a boilerplate file

I need someone that can write a PowerShell script (or even a bat script would probably be fine) that will recursively search through a directory tree of documents looking for files of 0 byte (they are corrupt files) and replace them with a small text file. The replacement file needs to be assigned the name as the file that was found and it needs to kept in the same location.

For example (as per the attached sketch), you start the search from c:\files which contains multiple subfolders one of which might be called August which also has multiple subfolders one of which might be called 3rd and within this subfolder there is a zero byte file called 034323.1, this file needs to be replaced with a predetermined text file that gets copied into the 3rd folder and given the same name of 034323.1. The script then moves on through the rest of the directory structure taking exactly the same approach with any other zero byte file encountered but ignoring/leaving every file that has a size greater than zero.

The basic functionality would be:

1. specify the starting location

2. specify the file that will be the 'boiler plate file'

3. write a log that includes every file touched/replaced and where it was found

4. preferably have the ability to include a date element which provides a mechanism to say 'update all files that were created before <this date> and are zero bytes'.

Compétences : Powershell, Script Shell

en voir plus : script replace files, script replace files linux, batch script break file smaller files, windows batch script moving files, replace text files linux script subdirectories, script replace text files subdirectories bash, batch script powershell coverter, find replace files xml file batch, powershell batch files convert, dos batch file search replace text files, convert dos batch script powershell, convert batch script powershell, split files batch script, write script linux delete files automatically, batch script string replace, batch script scan files, windows batch script replace string file, batch script find replace, how to write a powershell script

Concernant l'employeur :
( 0 commentaires ) PARADISE POINT, Australia

Nº du projet : #19954016

Décerné à:


Hi I'm Microsoft MCSA certified professional with extensive PowerShell expertise and experience in similar projects. I can provide the required script to replace corrupt files with "Boiler Plate file" depending on spec Plus

%selectedBids___i_sum_sub_7% %project_currencyDetails_sign_sub_8% AUD en 2 jours
(15 Commentaires)

6 freelance font une offre moyenne de $150 pour ce travail


Hi, I have over six years experience automating tasks with Powershell, I can do this job. Please see my work history for relevant feedback.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% AUD en 3 jours
(21 Commentaires)

I am good in powershell, batch scripting along with automation and development please let me know if you are good to award this project to me

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% AUD en 3 jours
(9 Commentaires)

hey I'm Romain, a French Microsoft certified guy I already wrote a lot of powershell scripts (you can have a look to my reviews) please contact me for more informations best regards, Romain

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% AUD en 2 jours
(7 Commentaires)

Hi, I have 14 years experience in infrastructure administration ( windows and Unix) ,past 8 years developer multiple infra automation scripts using Powershell, PowerCLI and vbs . I gone through your requirement, we can Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% AUD en 1 jour
(1 Évaluation)

I would be able to create a batch script that will do a recursive search for an empty file and if found will create a new text file. Looking forward to hear from you. regards sourabh Khadiwala

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% AUD en 5 jours
(0 Commentaires)