使用命令提示符查找和删除文件夹 [英] Locate and Delete Folder(s) with Command Prompt

查看:122
本文介绍了使用命令提示符查找和删除文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在工作中,我们每天处理需要在家中登录在线银行方面需要帮助的人员.有时候,我们需要用户删除文件并指导他们执行此操作,这在很多时候可能既令人厌烦又麻烦,因为用户没有计算机经验,因此浪费了多达20分钟的时间.

At work we handle people every day who wants help regarding signing on to their Online Bank from home. Some times we need the user to delete files and guiding them to do this, can be tiresome and bothersome a lot of the time, wasting upwards to 20 minutes because the user is inexperienced in computers.

我们一直在讨论一种解决方案(如果可能),在该解决方案中,我们让用户下载一个批处理文件,告诉他们运行该批处理文件,然后可以为我们删除所需的文件.我在这里问这个问题,因为我们每个人都不在工作中,具有处理批处理文件的经验.

We have been talking about a solution (if possible) where we let the user download a batch file that we tell them to run, which can then delete the required files for us. I ask this question here, because none of us here at work, have experience with batch files.

我个人有时会使用它,但是我无法真正找到适合我们需求的解决方案,而当我在网上搜索时,我也找不到适合的解决方案.该脚本必须自动找到该文件夹​​(如果可能).

Personally I've played around with it from time to time but I can't really come up with a solution that fits our needs and when I search around on the net, I can't find a solution that fits either. The script would have to locate the folder automatically (if possible).

  1. 这可能吗?
  2. 你能帮助我做到这一点吗?

提前谢谢!

推荐答案

一个简单的方法:

rd /s "%USERPROFILE%\.oces2"

如果它们遵循某种模式(例如,以.oces开头):

If they follow a pattern (e.g. start with .oces):

@echo off
cd /d "%USERPROFILE%"
for /d %%i in (.oces*) do rd /s "%%i"
pause

这篇关于使用命令提示符查找和删除文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆