调用另一个批处理的批处理文件无法复制文件

时间:2015-12-15 18:52:54

标签: batch-file call xcopy

我在设置计算机时使用了一系列批处理文件。我想要懒惰,而不是单独运行它们我想从一个批处理文件中调用它们。我有这个设置,但它没有完全工作。有一个批处理文件I CALL使用XCOPY来移动一堆快捷方式和图标,但只有在直接运行时才会在调用时复制它们。

我还尝试使用START,但它当时没有运行任何批处理文件。

主批,\ Post Install \ Run.bat

Call "Batch\Shortcuts.bat"

Shortcuts.bat,\ Post Install \ Batch \ Shortcuts.bat

@echo off
@echo Copying Icons And Shortcuts
@echo ................................................................................
xcopy /y /r /v "Shortcuts\Kronos.ico" "C:\Alle-Temp\"
@echo ................................................................................
xcopy /y /r /v "Shortcuts\Workday.ico" "C:\Alle-Temp\"
@echo ................................................................................
xcopy /y /r /v "Shortcuts\ADMS (New Windchill).url" "C:\Shortcuts\"
@echo ................................................................................
xcopy /y /r /v "Shortcuts\ADMS Drawing Lookup.url" "C:\Shortcuts\"
@echo ................................................................................
xcopy /y /r /v "Shortcuts\AMMS Web.url" "C:\Shortcuts\"
@echo ................................................................................
xcopy /y /r /v "Shortcuts\As-400.lnk" "C:\Shortcuts\"
@echo ................................................................................
xcopy /y /r /v "Shortcuts\WorkDay @ Work.lnk" "C:\Shortcuts\"
@echo ................................................................................
xcopy /y /r /v "Shortcuts\Kronos @ Work.url" "C:\Shortcuts\"
@echo ................................................................................
xcopy /y /r /v "Shortcuts\MapNetworkDrives - G & Q Drives Only.bat" "C:\Shortcuts\"
@echo ................................................................................
xcopy /y /r /v "Shortcuts\McAfee x64.bat" "C:\Users\EsAdmin\Desktop\"
@echo ................................................................................
pause

1 个答案:

答案 0 :(得分:0)

我相信你的解决方案是:

请务必在与所有图标和快捷方式相同的位置运行此批处理文件。

@echo off
echo Copying Icons And Shortcuts
echo ................................................................................
xcopy /y /r /v "Kronos.ico" "C:\Alle-Temp\"
echo ................................................................................
xcopy /y /r /v "Workday.ico" "C:\Alle-Temp\"
echo ................................................................................
xcopy /y /r /v "ADMS (New Windchill).url" "C:\Shortcuts\"
echo ................................................................................
xcopy /y /r /v "ADMS Drawing Lookup.url" "C:\Shortcuts\"
echo ................................................................................
xcopy /y /r /v "AMMS Web.url" "C:\Shortcuts\"
echo ................................................................................
xcopy /y /r /v "As-400.lnk" "C:\Shortcuts\"
echo ................................................................................
xcopy /y /r /v "WorkDay @ Work.lnk" "C:\Shortcuts\"
echo ................................................................................
xcopy /y /r /v "Kronos @ Work.url" "C:\Shortcuts\"
echo ................................................................................
xcopy /y /r /v "MapNetworkDrives - G & Q Drives Only.bat" "C:\Shortcuts\"
echo ................................................................................
xcopy /y /r /v "McAfee x64.bat" "C:\Users\EsAdmin\Desktop\"
echo ................................................................................
pause