Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  
albator

Replacing many files with zero-bytes clone ?

Recommended Posts

Hi, does someone know a dos command, script, software that can help me replace a bunch of file in a directory with file with the same name but empty ones ? (zero bytes)

Any help appreciated

Share this post


Link to post
Share on other sites

Saving an empty text file in notepad will produce a zero byte file which you can rename to whatever filename you'd like.

Share this post


Link to post
Share on other sites

I got a messy solution but it will work :)

Use a program like DirLister or LS to export a list of the filenames you need to create empty clones of.

Use Excel or any spreadsheet and paste "copy nul" or "type nul >"into a cell and fill it down the column the same number of files you are going to need. Then import that list into the next column. Concatenate and then copy paste that into a bat file. For Example:

create_empty_files.bat

copy nul name1.ext
copy nul name2.ext
copy nul name3.ext
copy nul name4.ext
copy nul name5.ext

Share this post


Link to post
Share on other sites

Try this bat file

empty_files.bat

for %%f in (*.txt;*.exe) do copy nul "%%f"

You can change (*.txt;*.exe) to something else, for example (*.*) if you want this to work for all files

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×