• Status: Solved
  • Priority: Low
  • Security: Public
  • Views: 90
  • Last Modified:

Application that parse folders based on folder format?

Is there a nice tool that can retrieve all folders in a certain directory that have a .v1 or .v2 folder extension (not file extension).  I need a list so I can delete those directories instead of manually doing it.  If anyone finds a tool or command that can do this, thank you!
0
mystikal1000
Asked:
mystikal1000
  • 3
  • 2
1 Solution
 
oBdACommented:
Powershell; this only tells you what it would delete. Remove the -WhatIf to delete the folders for real:
Get-ChildItem -Path C:\Temp -Recurse -Directory -Filter '*.v?' | Where-Object {$_.Name -match '\.v[12]\Z'} | Remove-Item -Recurse -WhatIf

Open in new window

0
 
mystikal1000Author Commented:
Thanks this is great, however it won't delete certain directories in the subfolders.  Is there a gui app that can filter these?
0
 
oBdACommented:
The directories it can't delete are usually ones where either
* the user attempting the deletion doesn't have the required permissions
or
* the item in question is opened in an application.
Neither of these cases can be resolved using a GUI or any other application. In the first case, an account with the required permissions needs to be used, in the second case, the application(s) holding the item(s) open need to be closed.
0
 
mystikal1000Author Commented:
The file path is too long...error

I deleted it manually with proper permissions and that worked.  I like the PS command, however a GUI would be better.
0
 
oBdACommented:
Don't know anything specific, GUI tool for that, sorry.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now