user1254261
user1254261

Reputation: 142

Command to delete folder from its part name.

How to get a full folder name from its partial or half name and delete it. suppose I have a folders in my temp directive

scoped_dir3364_20212,scoped_dir3894_27812

In those folders scoped_dir is common.i want to delete these directory from command prompt. please tell how to do that

Thanks

Upvotes: 0

Views: 582

Answers (1)

Sunny
Sunny

Reputation: 8332

Navigate to your temp directory in cmd and you could use the FOR /D command as below:

for /d %p in (scoped_dir*) do rd /s /q "%p"

In all cases for /d will start searching from the current directory.

More info is here...

Upvotes: 1

Related Questions