Jump to content

Replacing many files with zero-bytes clone ?


Recommended Posts

Posted

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


Posted

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

Posted

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

Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...