JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser .
I have a txt file on many folders and want to delete it
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.
OS
Windows 11 Pro
Computer type
Laptop
Manufacturer/Model
Lenovo T490s
CPU
Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz 2.11 GHz
Motherboard
Lenovo 20NYS6BN00
Memory
32 GB
Graphics Card(s)
Intel(R) UHD Graphics 620
Hard Drives
Kingston SNV251000G
Pragmatic Member
Pro User
VIP
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?
OS
Windows 11 Pro/All Channels
Computer type
Laptop
Manufacturer/Model
Acer Nitro ANV15-51
CPU
AMD Ryzen 7 7735HS 3200-4500 Mhz 8 cores x 2
Motherboard
Sportage_RBH
Memory
32 GB DDR5
Graphics Card(s)
Radeon Graphic / NVIDIA GeForce RTX 4060 8 GB GDDR6
Sound Card
AMD/Realtek(R) Audio
Monitor(s) Displays
Integrated Monitor (15.3"vis)
Screen Resolution
FHD 1920X1080 16:9 144Hz
Hard Drives
Kingston OM8SEP4512Q 500 GB
WDS500G2B0A-00SM50 500.1 GB
PSU
19V DC 6.32 A 120 W
Cooling
Dual Fans
Mouse
MS Bluetooth
Internet Speed
Fiber 1GB Cox -us & IGB Orange-fr
Browser
Edge Canary- Firefox Nightly-Chrome Dev-Chrome Dev
Antivirus
Windows Defender
Other Info
VMs of Windows 11 stable/Beta/Dev/Canary
VM of XeroLinux- Arch based & Debian 13 (Trixie)
Operating System
Windows 11 Insider Canary
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
Well-known member
VIP
Thread Starter
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.
OS
Windows 11 Pro
Computer type
Laptop
Manufacturer/Model
Lenovo T490s
CPU
Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz 2.11 GHz
Motherboard
Lenovo 20NYS6BN00
Memory
32 GB
Graphics Card(s)
Intel(R) UHD Graphics 620
Hard Drives
Kingston SNV251000G
Pragmatic Member
Pro User
VIP
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)
OS
Windows 11 Pro/All Channels
Computer type
Laptop
Manufacturer/Model
Acer Nitro ANV15-51
CPU
AMD Ryzen 7 7735HS 3200-4500 Mhz 8 cores x 2
Motherboard
Sportage_RBH
Memory
32 GB DDR5
Graphics Card(s)
Radeon Graphic / NVIDIA GeForce RTX 4060 8 GB GDDR6
Sound Card
AMD/Realtek(R) Audio
Monitor(s) Displays
Integrated Monitor (15.3"vis)
Screen Resolution
FHD 1920X1080 16:9 144Hz
Hard Drives
Kingston OM8SEP4512Q 500 GB
WDS500G2B0A-00SM50 500.1 GB
PSU
19V DC 6.32 A 120 W
Cooling
Dual Fans
Mouse
MS Bluetooth
Internet Speed
Fiber 1GB Cox -us & IGB Orange-fr
Browser
Edge Canary- Firefox Nightly-Chrome Dev-Chrome Dev
Antivirus
Windows Defender
Other Info
VMs of Windows 11 stable/Beta/Dev/Canary
VM of XeroLinux- Arch based & Debian 13 (Trixie)
Operating System
Windows 11 Insider Canary
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
Well-known member
VIP
Thread Starter
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 ?
OS
Windows 11 Pro
Computer type
Laptop
Manufacturer/Model
Lenovo T490s
CPU
Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz 2.11 GHz
Motherboard
Lenovo 20NYS6BN00
Memory
32 GB
Graphics Card(s)
Intel(R) UHD Graphics 620
Hard Drives
Kingston SNV251000G
Pragmatic Member
Pro User
VIP
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
OS
Windows 11 Pro/All Channels
Computer type
Laptop
Manufacturer/Model
Acer Nitro ANV15-51
CPU
AMD Ryzen 7 7735HS 3200-4500 Mhz 8 cores x 2
Motherboard
Sportage_RBH
Memory
32 GB DDR5
Graphics Card(s)
Radeon Graphic / NVIDIA GeForce RTX 4060 8 GB GDDR6
Sound Card
AMD/Realtek(R) Audio
Monitor(s) Displays
Integrated Monitor (15.3"vis)
Screen Resolution
FHD 1920X1080 16:9 144Hz
Hard Drives
Kingston OM8SEP4512Q 500 GB
WDS500G2B0A-00SM50 500.1 GB
PSU
19V DC 6.32 A 120 W
Cooling
Dual Fans
Mouse
MS Bluetooth
Internet Speed
Fiber 1GB Cox -us & IGB Orange-fr
Browser
Edge Canary- Firefox Nightly-Chrome Dev-Chrome Dev
Antivirus
Windows Defender
Other Info
VMs of Windows 11 stable/Beta/Dev/Canary
VM of XeroLinux- Arch based & Debian 13 (Trixie)
Operating System
Windows 11 Insider Canary
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
Well-known member
Pro User
VIP
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.
OS
Win11 Pro RTM Version 24H2 Build 26100.4202
Computer type
Laptop
Manufacturer/Model
Dell Vostro 3400
CPU
Intel Core i5 11th Gen. 2.40GHz
Memory
12GB
Hard Drives
256GB SSD NVMe M.2
Operating System
Win11 Pro RTM Version 24H2 Build 26100.4202
Computer type
PC/Desktop
Manufacturer/Model
Dell Vostro 5890
CPU
Intel Core i5 10th Gen. 2.90GHz
Memory
16GB
Graphics card(s)
Onboard, no VGA, using a DisplayPort-to-VGA adapter
Monitor(s) Displays
24" Dell
Hard Drives
512GB SSD NVMe, 4TB Seagate HDD
Browser
Firefox, Edge
Antivirus
Windows Defender/Microsoft Security
Jack of all trades – master of none
Pro User
VIP
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: Nov 24, 2022
OS
11 Home
Computer type
Laptop
Manufacturer/Model
Asus TUF Gaming F16 (2024)
CPU
i7 13650HX
Memory
16GB DDR5
Graphics Card(s)
GeForce RTX 4060 Mobile
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
512GB SSD internal
37TB external
PSU
Li-ion
Cooling
2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
Keyboard
Logitech K800
Mouse
Logitech G402
Internet Speed
20Mbit/s up, 250Mbit/s down
Browser
FF
Operating System
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, 250Mbit/s down
Browser
FF
Well-known member
VIP
Thread Starter
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:
Well it have $ sign aswell maybe cmd is not accepting special character ?
OS
Windows 11 Pro
Computer type
Laptop
Manufacturer/Model
Lenovo T490s
CPU
Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz 2.11 GHz
Motherboard
Lenovo 20NYS6BN00
Memory
32 GB
Graphics Card(s)
Intel(R) UHD Graphics 620
Hard Drives
Kingston SNV251000G
Pragmatic Member
Pro User
VIP
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.
OS
Windows 11 Pro/All Channels
Computer type
Laptop
Manufacturer/Model
Acer Nitro ANV15-51
CPU
AMD Ryzen 7 7735HS 3200-4500 Mhz 8 cores x 2
Motherboard
Sportage_RBH
Memory
32 GB DDR5
Graphics Card(s)
Radeon Graphic / NVIDIA GeForce RTX 4060 8 GB GDDR6
Sound Card
AMD/Realtek(R) Audio
Monitor(s) Displays
Integrated Monitor (15.3"vis)
Screen Resolution
FHD 1920X1080 16:9 144Hz
Hard Drives
Kingston OM8SEP4512Q 500 GB
WDS500G2B0A-00SM50 500.1 GB
PSU
19V DC 6.32 A 120 W
Cooling
Dual Fans
Mouse
MS Bluetooth
Internet Speed
Fiber 1GB Cox -us & IGB Orange-fr
Browser
Edge Canary- Firefox Nightly-Chrome Dev-Chrome Dev
Antivirus
Windows Defender
Other Info
VMs of Windows 11 stable/Beta/Dev/Canary
VM of XeroLinux- Arch based & Debian 13 (Trixie)
Operating System
Windows 11 Insider Canary
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
Well-known member
VIP
Thread Starter
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.
OS
Windows 11 Pro
Computer type
Laptop
Manufacturer/Model
Lenovo T490s
CPU
Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz 2.11 GHz
Motherboard
Lenovo 20NYS6BN00
Memory
32 GB
Graphics Card(s)
Intel(R) UHD Graphics 620
Hard Drives
Kingston SNV251000G
Pragmatic Member
Pro User
VIP
OS
Windows 11 Pro/All Channels
Computer type
Laptop
Manufacturer/Model
Acer Nitro ANV15-51
CPU
AMD Ryzen 7 7735HS 3200-4500 Mhz 8 cores x 2
Motherboard
Sportage_RBH
Memory
32 GB DDR5
Graphics Card(s)
Radeon Graphic / NVIDIA GeForce RTX 4060 8 GB GDDR6
Sound Card
AMD/Realtek(R) Audio
Monitor(s) Displays
Integrated Monitor (15.3"vis)
Screen Resolution
FHD 1920X1080 16:9 144Hz
Hard Drives
Kingston OM8SEP4512Q 500 GB
WDS500G2B0A-00SM50 500.1 GB
PSU
19V DC 6.32 A 120 W
Cooling
Dual Fans
Mouse
MS Bluetooth
Internet Speed
Fiber 1GB Cox -us & IGB Orange-fr
Browser
Edge Canary- Firefox Nightly-Chrome Dev-Chrome Dev
Antivirus
Windows Defender
Other Info
VMs of Windows 11 stable/Beta/Dev/Canary
VM of XeroLinux- Arch based & Debian 13 (Trixie)
Operating System
Windows 11 Insider Canary
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
Well-known member
Pro User
VIP
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.
OS
Win11 Pro RTM Version 24H2 Build 26100.4202
Computer type
Laptop
Manufacturer/Model
Dell Vostro 3400
CPU
Intel Core i5 11th Gen. 2.40GHz
Memory
12GB
Hard Drives
256GB SSD NVMe M.2
Operating System
Win11 Pro RTM Version 24H2 Build 26100.4202
Computer type
PC/Desktop
Manufacturer/Model
Dell Vostro 5890
CPU
Intel Core i5 10th Gen. 2.90GHz
Memory
16GB
Graphics card(s)
Onboard, no VGA, using a DisplayPort-to-VGA adapter
Monitor(s) Displays
24" Dell
Hard Drives
512GB SSD NVMe, 4TB Seagate HDD
Browser
Firefox, Edge
Antivirus
Windows Defender/Microsoft Security
Well-known member
VIP
Thread Starter
Good. And it's not actually a 'trick' but a feature of the file managers, goes back a'ways.
Yes you are right which I forgot to use it lol.
OS
Windows 11 Pro
Computer type
Laptop
Manufacturer/Model
Lenovo T490s
CPU
Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz 2.11 GHz
Motherboard
Lenovo 20NYS6BN00
Memory
32 GB
Graphics Card(s)
Intel(R) UHD Graphics 620
Hard Drives
Kingston SNV251000G