Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.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_Shell_Powershell_Batch File - Fatal编程技术网

Windows 要先移动最新文件夹的批处理文件?

Windows 要先移动最新文件夹的批处理文件?,windows,shell,powershell,batch-file,Windows,Shell,Powershell,Batch File,要先移动最新文件夹的批处理文件 例如,我有一个将文件夹从本地计算机移动到远程计算机的批处理文件,有没有办法先移动最近创建的文件夹 目前我有以下几点: xcopy /s C:\Users\xxxx\Desktop\AutoFrameworkResults \\192.1xx.1.xx\xxxx\xxxxx\Common\AutoFrameworkResults 谢谢你的帮助我可能来不及参加聚会了,不过这是剧本 setlocal set "sourceDir=c:\users\xxxx\desk

要先移动最新文件夹的批处理文件

例如,我有一个将文件夹从本地计算机移动到远程计算机的批处理文件,有没有办法先移动最近创建的文件夹

目前我有以下几点:

xcopy /s C:\Users\xxxx\Desktop\AutoFrameworkResults \\192.1xx.1.xx\xxxx\xxxxx\Common\AutoFrameworkResults


谢谢你的帮助

我可能来不及参加聚会了,不过这是剧本

setlocal
set "sourceDir=c:\users\xxxx\desktop\autoframeworkresults"
set "destDir=\\192.1xx.1xx\xxxx\xxxx\common\autoframeworkresults"

for /f "delims=" %%d in ('dir "%sourceDir%" /o-d /ad /b') do (
  xcopy /s "%sourceDir%\%%d" "%destDir%\%%d\"
)

我可能来不及参加聚会了,但这是剧本

setlocal
set "sourceDir=c:\users\xxxx\desktop\autoframeworkresults"
set "destDir=\\192.1xx.1xx\xxxx\xxxx\common\autoframeworkresults"

for /f "delims=" %%d in ('dir "%sourceDir%" /o-d /ad /b') do (
  xcopy /s "%sourceDir%\%%d" "%destDir%\%%d\"
)

@Melebius谢谢我可以在xcopy之后添加代码吗?@Melebius您已经给出了正确的方向:-)谢谢大家的支持help@Melebius谢谢,我可以在xcopy之后添加代码吗?@Melebius您已经给出了正确的方向:-)谢谢大家的帮助我如何关闭递归,所以不要一直提示覆盖文件?感谢againI我真的不知道您在给定上下文中使用recursive是什么意思,但是您可以将/y开关添加到xcopy命令中,以抑制覆盖现有目标文件的提示。这正是我要查找的@treintje感谢我将在xcopy后面添加我如何关闭recursive,那么,您是否一直提示覆盖该文件?感谢againI我真的不知道在给定的上下文中递归是什么意思,但是您可以将/y开关添加到xcopy命令中,以抑制覆盖现有目标文件的提示。这正是我要寻找的@treintje谢谢我将在xcopy后面添加