Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 如何编程批处理文件以从源复制到目标_Windows_Windows Vista - Fatal编程技术网

Windows 如何编程批处理文件以从源复制到目标

Windows 如何编程批处理文件以从源复制到目标,windows,windows-vista,Windows,Windows Vista,我需要编写一个批处理文件,以便从源文件复制到目标文件。用户输入源和目标路径后,批处理文件将文件从源复制到目标。到目前为止我有 set /p source=\PATH\TO\SOURCE xcopy %source% "c:\PATH\TO\DESTINATION" /e /h /k /o 但这只允许用户输入源路径的输入。我需要的代码,允许用户输入目标路径以及。非常感谢您的帮助 这样做: SET /P USERSOURCE=Please enter the source path: SET /

我需要编写一个批处理文件,以便从源文件复制到目标文件。用户输入源和目标路径后,批处理文件将文件从源复制到目标。到目前为止我有

set /p source=\PATH\TO\SOURCE
xcopy %source% "c:\PATH\TO\DESTINATION" /e /h /k /o

但这只允许用户输入源路径的输入。我需要的代码,允许用户输入目标路径以及。非常感谢您的帮助

这样做:

SET /P USERSOURCE=Please enter the source path: 
SET /P USERDEST=Please enter the destination path:
xcopy %USERSOURCE% %USERDEST% /e /h /k /o

这应该是您想要的(只要您列出的参数正确)。

执行以下操作:

SET /P USERSOURCE=Please enter the source path: 
SET /P USERDEST=Please enter the destination path:
xcopy %USERSOURCE% %USERDEST% /e /h /k /o

这应该是您想要的(只要您列出的参数正确)。

请记住这不是即时消息。有时你得到答复,有时你得不到答复。乞讨只是一种喧闹,最终会被版主标记为评论。请记住这不是即时消息。有时你得到答复,有时你得不到答复。乞求一个只不过是噪音,最终会让版主对事情进行审查。