批量:重命名“程序文件”中的文件夹

发布于 2024-08-24 05:46:14 字数 250 浏览 2 评论 0原文

我需要编写一个批处理来重命名 Program Files 中的文件夹。

我可以通过资源管理器来完成此操作,所以我想我拥有所有必需的权限。

但是,当我在命令行中编写类似的内容时:

move "C:\Program Files\Ceebot4\train" train_old

我收到以下错误:访问被拒绝。

可以这样做吗?

I need to write a batch to rename a folder in Program Files.

I'm able to do it through the Explorer, so I guess I have all required rights.

But when I write something like this in a command line :

move "C:\Program Files\Ceebot4\train" train_old

I get the following error : Access denied.

Is it possible to do it ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

空名 2024-08-31 05:46:14

批处理文件在 MS-Dos 模式下运行,因此对 Windows 资源管理器具有不同的访问权限。尝试以管理员身份运行批处理文件或 Dos 提示符应该可以

A batch file runs in MS-Dos mode and so is subject to different access rights to Windows Explorer. Try running your batch file or Dos prompt as an administrator should work

巷雨优美回忆 2024-08-31 05:46:14

您正在尝试将内容移动到执行命令时当前所在目录下名为 train_old 的目录中。如果您想重命名当前位置的目录,则必须使用:

move "C:\Program Files\Ceebot4\train" "C:\Program Files\Ceebot4\train_old"

You are trying to move the contents to a directory named train_old right under the directory where you currently are when executing the command. If you want to rename the directory in current place you will have to use:

move "C:\Program Files\Ceebot4\train" "C:\Program Files\Ceebot4\train_old"
无可置疑 2024-08-31 05:46:14

move 移动东西,所以要么按照 Anders 所说的做(在两个地方给出完整路径;但要小心目标名称不存在),或者使用 ren 代替:

ren "C:\Program Files\Ceebot4\train" train_old

move moves things, so either do what Anders said (giving the full path in both places; but be careful the target name doesn't already exist), or use ren instead:

ren "C:\Program Files\Ceebot4\train" train_old
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文