windows Windows批处理编程中的用户输入
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6637399/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
User Input in Windows batch Programming
提问by Mareena
Possible Duplicate:
User Input Operation in Windows batch Programming
可能的重复:
Windows 批处理编程中的用户输入操作
I have three folders on my system and same folders are on the remote system. e.g.
我的系统上有三个文件夹,远程系统上也有相同的文件夹。例如
30062011
22062011
15062011
What I want is basically an user input, which will transfer the contents of above folders to other folders of remote system, like if user enters 30062011
, then the contents of this folder (30062011) from my system to the folder (30062011) of remote system should be moved and so on.
我想要的基本上是一个用户输入,它会将上述文件夹的内容传输到远程系统的其他文件夹,就像如果用户输入30062011
,那么这个文件夹(30062011)的内容从我的系统到远程系统的文件夹(30062011)应该移动等等。
Please help.
请帮忙。
回答by manojlds
You can use something like below:
您可以使用以下内容:
set /P folder=Enter folder name:
Then use %folder%
to copy the entered folder name
然后使用%folder%
复制输入的文件夹名称
PS: You should consider providing sample code of what you had tried. Not just ask questions on what you want accomplished, that is not what Stackoverflow is for.
PS:您应该考虑提供您尝试过的示例代码。不仅仅是问你想要完成什么的问题,这不是 Stackoverflow 的目的。
回答by NGLN
@echo off
echo.
set /P C=Move all files from which folder name?
move [From path]\%C%\*.* [To path]\%C%\
exit