I have a txt file on many folders and want to delete it


jk22

Member
VIP
Local time
6:05 PM
Posts
39
OS
Windows 11 Pro
Hey guys,

I have alot of sub-folders like more than 100 in 1 folder and on all sub-folder there is 1 txt file which I want to delete it. Is there any way ? Or any Commandar can do it like Speed Commandar or Total Commandar or One Commandar ?

Regards.
 

My Computer

System One

  • OS
    Windows 11 Pro

OAT

I never seem to know enough.
Member
Local time
6:05 AM
Posts
233
Location
San Diego, CA
OS
Windows 11 Pro FW Dev/VM XeroLinux
Is the .txt file the same name in all folders, are there other .txt file in those folders?
And in which top folder of the drive do the .txt files reside?
 

My Computers

System One System Two

  • OS
    Windows 11 Pro FW Dev/VM XeroLinux
    Computer type
    Laptop
    Manufacturer/Model
    ASUSTeK COMPUTER INC. TUF Gaming FX705GM 1.0
    CPU
    2.20 gigahertz Intel i7-8750H Hyper-threaded 12 cores
    Motherboard
    ASUSTeK COMPUTER INC. FX705GM 1.0
    Memory
    24428 Megabytes
    Graphics Card(s)
    Intel(R) UHD Graphics 630 / NVIDIA GeForce GTX 1060
    Sound Card
    Intel(R) Display Audio / Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (17.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9
    Hard Drives
    2 SSD SATA/NVM Express 1.3
    WDS500G2B0A-00SM50 500.1 GB
    WDC PC SN520 SDAPNUW-256G-1002 256 GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Keyboard
    AZERTY
    Mouse
    MS Bluetooth
    Internet Speed
    ADSL
    Browser
    Edge Canary- Firefox Nightly
    Antivirus
    Windows Defender
  • Operating System
    Windows 11 Insider Beta
    Computer type
    Laptop
    Manufacturer/Model
    ASUS X751BP
    CPU
    AMD Dual Core A6-9220
    Motherboard
    ASUS
    Memory
    8 GB
    Graphics card(s)
    AMD Radeon R5 M420
    Sound Card
    Realtek
    Monitor(s) Displays
    17.3
    Screen Resolution
    1600X900 16:9
    Hard Drives
    1TB 5400RPM

jk22

Member
VIP
Thread Starter
Local time
6:05 PM
Posts
39
OS
Windows 11 Pro
Is the .txt file the same name in all folders, are there other .txt file in those folders?
And in which top folder of the drive do the .txt files reside?
Yes same name of that txt file in all folders and yes there are many other .txt files.

Its on my Desktop folder.
 

My Computer

System One

  • OS
    Windows 11 Pro

OAT

I never seem to know enough.
Member
Local time
6:05 AM
Posts
233
Location
San Diego, CA
OS
Windows 11 Pro FW Dev/VM XeroLinux
Open your desktop folder thru explorer
In the address bar, type in cmd > enter
at a command prompt:
del [yourtxtfilename].txt /s /p
This will delete that text file recursively stopping at each page (for you to verify- press enter to continue)
 

My Computers

System One System Two

  • OS
    Windows 11 Pro FW Dev/VM XeroLinux
    Computer type
    Laptop
    Manufacturer/Model
    ASUSTeK COMPUTER INC. TUF Gaming FX705GM 1.0
    CPU
    2.20 gigahertz Intel i7-8750H Hyper-threaded 12 cores
    Motherboard
    ASUSTeK COMPUTER INC. FX705GM 1.0
    Memory
    24428 Megabytes
    Graphics Card(s)
    Intel(R) UHD Graphics 630 / NVIDIA GeForce GTX 1060
    Sound Card
    Intel(R) Display Audio / Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (17.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9
    Hard Drives
    2 SSD SATA/NVM Express 1.3
    WDS500G2B0A-00SM50 500.1 GB
    WDC PC SN520 SDAPNUW-256G-1002 256 GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Keyboard
    AZERTY
    Mouse
    MS Bluetooth
    Internet Speed
    ADSL
    Browser
    Edge Canary- Firefox Nightly
    Antivirus
    Windows Defender
  • Operating System
    Windows 11 Insider Beta
    Computer type
    Laptop
    Manufacturer/Model
    ASUS X751BP
    CPU
    AMD Dual Core A6-9220
    Motherboard
    ASUS
    Memory
    8 GB
    Graphics card(s)
    AMD Radeon R5 M420
    Sound Card
    Realtek
    Monitor(s) Displays
    17.3
    Screen Resolution
    1600X900 16:9
    Hard Drives
    1TB 5400RPM

jk22

Member
VIP
Thread Starter
Local time
6:05 PM
Posts
39
OS
Windows 11 Pro
Open your desktop folder thru explorer
In the address bar, type in cmd > enter
at a command prompt:
del [yourtxtfilename].txt /s /p
This will delete that text file recursively stopping at each page (for you to verify- press enter to continue)
That command will delete that .txt file from all sub-folders ?
 

My Computer

System One

  • OS
    Windows 11 Pro

OAT

I never seem to know enough.
Member
Local time
6:05 AM
Posts
233
Location
San Diego, CA
OS
Windows 11 Pro FW Dev/VM XeroLinux
That is what you asked for? Right?
Of course, you need to replace [yourtxtfilename] with your file name without brackets and there is a space between /s & /p
 

My Computers

System One System Two

  • OS
    Windows 11 Pro FW Dev/VM XeroLinux
    Computer type
    Laptop
    Manufacturer/Model
    ASUSTeK COMPUTER INC. TUF Gaming FX705GM 1.0
    CPU
    2.20 gigahertz Intel i7-8750H Hyper-threaded 12 cores
    Motherboard
    ASUSTeK COMPUTER INC. FX705GM 1.0
    Memory
    24428 Megabytes
    Graphics Card(s)
    Intel(R) UHD Graphics 630 / NVIDIA GeForce GTX 1060
    Sound Card
    Intel(R) Display Audio / Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (17.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9
    Hard Drives
    2 SSD SATA/NVM Express 1.3
    WDS500G2B0A-00SM50 500.1 GB
    WDC PC SN520 SDAPNUW-256G-1002 256 GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Keyboard
    AZERTY
    Mouse
    MS Bluetooth
    Internet Speed
    ADSL
    Browser
    Edge Canary- Firefox Nightly
    Antivirus
    Windows Defender
  • Operating System
    Windows 11 Insider Beta
    Computer type
    Laptop
    Manufacturer/Model
    ASUS X751BP
    CPU
    AMD Dual Core A6-9220
    Motherboard
    ASUS
    Memory
    8 GB
    Graphics card(s)
    AMD Radeon R5 M420
    Sound Card
    Realtek
    Monitor(s) Displays
    17.3
    Screen Resolution
    1600X900 16:9
    Hard Drives
    1TB 5400RPM

Berton

Well-known member
Power User
VIP
Local time
6:05 AM
Posts
1,413
Location
Buffalo, Wyoming
OS
Win11 Pro RTM
One thing I've used is clicking the main/first folder, go to Search and enter *.txt and search then Select all then delete the files found. The * is a wild card if not needing to know the whole file name.
 

My Computers

System One System Two

  • OS
    Win11 Pro RTM
    Computer type
    Laptop
    Manufacturer/Model
    Dell Vostro 3400
    CPU
    Intel Core i5
    Memory
    8GB
    Hard Drives
    256GB SSD NVMe
  • Operating System
    Windows 11 Pro RTM x64
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Vostro 5890
    CPU
    Intel Core i5
    Memory
    16GB
    Graphics card(s)
    Onboard, no VGA, using a DisplayPort-to-VGA adapter
    Monitor(s) Displays
    21"
    Hard Drives
    512GB SSD NVMe, 2TB WDC HDD
    Browser
    Firefox, Edge
    Antivirus
    Windows Defender/Microsoft Security
  • Like
Reactions: OAT

hdmi

Well-known member
Power User
VIP
Local time
2:05 PM
Posts
763
Location
Belgium
OS
11 Home
That command will delete that .txt file from all sub-folders ?
All except ones that are hidden or have their read-only attribute set. You can add the /A option to also delete files that are hidden, and/or can add the /F option to also delete files that are read-only. So del [yourtxtfilename].txt /s /p /a /f will delete all occurrences of the specified file, also including in subfolders and also including if the file is hidden and/or is read-only.

EDIT: If you prefer, you can omit the /P option and instead redirect the output of the command to a new textfile. For example, del [yourtxtfilename].txt /s >"%userprofile%\Desktop\DeletedFiles.txt" will write the command's output to a textfile DeletedFiles.txt that will be created on your desktop. (If the file DeletedFiles.txt already exists on your desktop, it will be overwritten.)
 
Last edited:

My Computer

System One

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    20Mbit/s up, 200Mbit/s down
    Browser
    FF

jk22

Member
VIP
Thread Starter
Local time
6:05 PM
Posts
39
OS
Windows 11 Pro
Open your desktop folder thru explorer
In the address bar, type in cmd > enter
at a command prompt:
del [yourtxtfilename].txt /s /p
This will delete that text file recursively stopping at each page (for you to verify- press enter to continue)
Its say this:
9c15695995.png


Well it have $ sign aswell maybe cmd is not accepting special character ?
 

My Computer

System One

  • OS
    Windows 11 Pro

OAT

I never seem to know enough.
Member
Local time
6:05 AM
Posts
233
Location
San Diego, CA
OS
Windows 11 Pro FW Dev/VM XeroLinux
No $ sign is OK,
Can you from the same location (top), do
Attrib -h -r -s *.* /d (you may get an access denied if some files are in use)
and then do the delete command above.
Please attach a screenshot if that does not work.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro FW Dev/VM XeroLinux
    Computer type
    Laptop
    Manufacturer/Model
    ASUSTeK COMPUTER INC. TUF Gaming FX705GM 1.0
    CPU
    2.20 gigahertz Intel i7-8750H Hyper-threaded 12 cores
    Motherboard
    ASUSTeK COMPUTER INC. FX705GM 1.0
    Memory
    24428 Megabytes
    Graphics Card(s)
    Intel(R) UHD Graphics 630 / NVIDIA GeForce GTX 1060
    Sound Card
    Intel(R) Display Audio / Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (17.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9
    Hard Drives
    2 SSD SATA/NVM Express 1.3
    WDS500G2B0A-00SM50 500.1 GB
    WDC PC SN520 SDAPNUW-256G-1002 256 GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Keyboard
    AZERTY
    Mouse
    MS Bluetooth
    Internet Speed
    ADSL
    Browser
    Edge Canary- Firefox Nightly
    Antivirus
    Windows Defender
  • Operating System
    Windows 11 Insider Beta
    Computer type
    Laptop
    Manufacturer/Model
    ASUS X751BP
    CPU
    AMD Dual Core A6-9220
    Motherboard
    ASUS
    Memory
    8 GB
    Graphics card(s)
    AMD Radeon R5 M420
    Sound Card
    Realtek
    Monitor(s) Displays
    17.3
    Screen Resolution
    1600X900 16:9
    Hard Drives
    1TB 5400RPM

jk22

Member
VIP
Thread Starter
Local time
6:05 PM
Posts
39
OS
Windows 11 Pro
One thing I've used is clicking the main/first folder, go to Search and enter *.txt and search then Select all then delete the files found. The * is a wild card if not needing to know the whole file name.
I have used your trick and it worked.
No $ sign is OK,
Can you from the same location (top), do
Attrib -h -r -s *.* /d (you may get an access denied if some files are in use)
and then do the delete command above.
Please attach a screenshot if that does not work.
I have used the search option from Search This PC and it worked.
 

My Computer

System One

  • OS
    Windows 11 Pro
  • Like
Reactions: OAT

OAT

I never seem to know enough.
Member
Local time
6:05 AM
Posts
233
Location
San Diego, CA
OS
Windows 11 Pro FW Dev/VM XeroLinux
Good, I am glad.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro FW Dev/VM XeroLinux
    Computer type
    Laptop
    Manufacturer/Model
    ASUSTeK COMPUTER INC. TUF Gaming FX705GM 1.0
    CPU
    2.20 gigahertz Intel i7-8750H Hyper-threaded 12 cores
    Motherboard
    ASUSTeK COMPUTER INC. FX705GM 1.0
    Memory
    24428 Megabytes
    Graphics Card(s)
    Intel(R) UHD Graphics 630 / NVIDIA GeForce GTX 1060
    Sound Card
    Intel(R) Display Audio / Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (17.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9
    Hard Drives
    2 SSD SATA/NVM Express 1.3
    WDS500G2B0A-00SM50 500.1 GB
    WDC PC SN520 SDAPNUW-256G-1002 256 GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Keyboard
    AZERTY
    Mouse
    MS Bluetooth
    Internet Speed
    ADSL
    Browser
    Edge Canary- Firefox Nightly
    Antivirus
    Windows Defender
  • Operating System
    Windows 11 Insider Beta
    Computer type
    Laptop
    Manufacturer/Model
    ASUS X751BP
    CPU
    AMD Dual Core A6-9220
    Motherboard
    ASUS
    Memory
    8 GB
    Graphics card(s)
    AMD Radeon R5 M420
    Sound Card
    Realtek
    Monitor(s) Displays
    17.3
    Screen Resolution
    1600X900 16:9
    Hard Drives
    1TB 5400RPM

Berton

Well-known member
Power User
VIP
Local time
6:05 AM
Posts
1,413
Location
Buffalo, Wyoming
OS
Win11 Pro RTM
I have used your trick and it worked.
Good. And it's not actually a 'trick' but a feature of the file managers, goes back a'ways.
 

My Computers

System One System Two

  • OS
    Win11 Pro RTM
    Computer type
    Laptop
    Manufacturer/Model
    Dell Vostro 3400
    CPU
    Intel Core i5
    Memory
    8GB
    Hard Drives
    256GB SSD NVMe
  • Operating System
    Windows 11 Pro RTM x64
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Vostro 5890
    CPU
    Intel Core i5
    Memory
    16GB
    Graphics card(s)
    Onboard, no VGA, using a DisplayPort-to-VGA adapter
    Monitor(s) Displays
    21"
    Hard Drives
    512GB SSD NVMe, 2TB WDC HDD
    Browser
    Firefox, Edge
    Antivirus
    Windows Defender/Microsoft Security

Latest Support Threads

Top Bottom