# How To Copy A List Of File Names To Text File

**URL:** <https://onehack.st/t/how-to-copy-a-list-of-file-names-to-text-file/229848>\
**Category:** Tutorials & Methods\
**Tags:** tools, tips-tricks\
**Created:** [December 15, 2022, 9:08pm UTC](https://onehack.st/t/how-to-copy-a-list-of-file-names-to-text-file/229848 "2022-12-15T21:08:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Astrid](https://onehack.st/user_avatar/onehack.st/astrid/32/174869_2.png) [@Astrid](https://onehack.st/u/Astrid)\
**Post date:** [December 15, 2022, 9:08pm UTC](https://onehack.st/t/how-to-copy-a-list-of-file-names-to-text-file/229848/1 "2022-12-15T21:08:31Z")

</div>

How to copy a list of file names to text file? | 99 files names = 1 file

 ![image](https://onehack.st/uploads/default/original/3X/a/6/a61a8a97102161ebc69252018535a87571618bdd.png)

This tutorial will be very useful for several users here who got troubles with logs , or any type of duplicated shit!

It’s very, very easy in the Windows Command-Line Interpreter (all Windows OSes):

- Open a command prompt (Start → Run → cmd Enter) must run as administrator
- Navigate folder where you save txt files.
- Enter dir \> name.txt After that type dir \> C:\dir.txt and press Enter.

**Enjoy!**

---

<div class="post-metadata">

**Author:** ![Roberto\_Diaz](https://onehack.st/user_avatar/onehack.st/roberto_diaz/32/18084_2.png) [@Roberto\_Diaz](https://onehack.st/u/Roberto_Diaz)\
**Post date:** [December 17, 2022, 11:16am UTC](https://onehack.st/t/how-to-copy-a-list-of-file-names-to-text-file/229848/2 "2022-12-17T11:16:21Z")

</div>

Hi @Astrid  
Thank you very much for remid me my old DOS time.

---

<div class="post-metadata">

**Author:** ![La\_Signora](https://onehack.st/user_avatar/onehack.st/la_signora/32/115755_2.png) [@La\_Signora](https://onehack.st/u/La_Signora)\
**Post date:** [December 19, 2022, 8:44am UTC](https://onehack.st/t/how-to-copy-a-list-of-file-names-to-text-file/229848/3 "2022-12-19T08:44:19Z")

</div>

If you just want the names, then you can use the below `Powershell` command

```auto
ls | ForEach {$_.Name}

```
