Windows XP:推出我自己的桌面工具来复制目录名称列表

发布于 2024-12-29 06:46:09 字数 610 浏览 7 评论 0原文

很多时候,我发现需要将目录名称从一个目录复制到另一个目录,并在稍后创建一个空目录列表。

我已经使用以下命令完成了此任务:

for /F "usebackq" %i IN (`dir /b C:/backups/sites/24/01/2012`) DO makdir C:\fabio_temp\test\%i

现在我想创建一个可重用且友好的工具,这样我就不必一直在命令行上输入它。

我想要的伪语言示例:

$dir = PROMPT('Type in the name of the directory containing the list of directories to clone:');
$dir_dest = PROMPT('Type in the destination directory:');

FOREACH LIST_DIRNAMES($dir) AS $dirname DO
    MKDIR CONCAT($dir_dest,$dirname)
ENDFOREACH;

那么,如果这个函数出现在右键单击上下文菜单中,那就太好了。为此使用什么语言并不重要。它可能是 vbscript,或者其他什么,我不知道。

Many times I have found the need to copy directory names from one directory into another, creating a list of empty directories in the later.

I have achieved this task using the following command:

for /F "usebackq" %i IN (`dir /b C:/backups/sites/24/01/2012`) DO makdir C:\fabio_temp\test\%i

Now i would like to create a reusable and friendly tool so that i don't have to be typing this all the time on the command line.

Example of what I want in pseudo-language:

$dir = PROMPT('Type in the name of the directory containing the list of directories to clone:');
$dir_dest = PROMPT('Type in the destination directory:');

FOREACH LIST_DIRNAMES($dir) AS $dirname DO
    MKDIR CONCAT($dir_dest,$dirname)
ENDFOREACH;

Then, it would be nice to have this function appearing in the right-click context menu. It doesn't matter what language is going to be used for this. It could be vbscript, or whatever, I don't know.

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

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

发布评论

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

评论(1

濫情▎り 2025-01-05 06:46:09

感谢 @AlbertoSolano 建议的教程,我能够编写一个名为 mkdirs_from_list.bat 的简单脚本,其中包含以下内容:

for /F "usebackq" %%i IN (`dir %1 /b`) DO mkdir %2\%%i

这正是我所要求的,并且,为了让事情变得更容易,我正在将脚本添加到路径环境中,因此可以在命令行上像这样调用它:

mkdirs_from_list C:\dir_to_list C:\dir_dest

我想要一些更友好的东西,例如弹出提示,能够浏览目录或类似的东西,但我认为这会够了。

Thanks to the tutorial that @AlbertoSolano suggested, I was able to write a simple script named mkdirs_from_list.bat with the following content:

for /F "usebackq" %%i IN (`dir %1 /b`) DO mkdir %2\%%i

That does exactly what I was asking for, and, to make things easier, I'm adding the script to the path environment, so it can be invoked like this on the command line:

mkdirs_from_list C:\dir_to_list C:\dir_dest

I wanted something more friendly, like a prompt popping up, being able to browse the directories, or something alike, but I think this will suffice.

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