Windows XP:推出我自己的桌面工具来复制目录名称列表
很多时候,我发现需要将目录名称从一个目录复制到另一个目录,并在稍后创建一个空目录列表。
我已经使用以下命令完成了此任务:
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢 @AlbertoSolano 建议的教程,我能够编写一个名为
mkdirs_from_list.bat
的简单脚本,其中包含以下内容:这正是我所要求的,并且,为了让事情变得更容易,我正在将脚本添加到路径环境中,因此可以在命令行上像这样调用它:
我想要一些更友好的东西,例如弹出提示,能够浏览目录或类似的东西,但我认为这会够了。
Thanks to the tutorial that @AlbertoSolano suggested, I was able to write a simple script named
mkdirs_from_list.bat
with the following content: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:
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.