troubleshooting Question

Delete multiple text files via dos command line

Avatar of RandallVillalobos
RandallVillalobosFlag for Costa Rica asked on
Microsoft DOSShell ScriptingMicrosoft Legacy OS
14 Comments2 Solutions661 ViewsLast Modified:
Experts,

I need to remove multiple text files via the command line.
In example:
C:\1.txt
C:\2.txt
C:\3.txt
C:\4.txt
C:\5.txt

------------

I tried the following batch file with no success, deletes the first line and then the batch files just "HANGS".

@echo off
del /q /s \\computername1\c$\1.txt
del /q /s \\computername1\c$\2.txt
etc etc etc
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 14 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros