多个命令在一个batch file中的问题

我是新来的,所以要温柔:)

我试图编写补丁文件开始批处理,并将其转换为exe文件一旦完成。

我有两个batch file,当单独执行,但是当我join到batch file(join之一)的第二部分中的一个不是完成任务(不添加registry项)时,工作得很好。

可以请你看看波纹pipe批次,让我知道我犯了什么错误(请注意这是特定于应用程序)

谢谢你提前

错误第1部分是删除目录和移动文件但是2dn不创buildregistry项请帮助

comd /c @echo ofF xcopy /y C:\ProgramData\Jeppesen\Common\TerminalChartsTemp C:\ProgramData\Jeppesen\Common\TerminalCharts rmdir /s /q C:\ProgramData\Jeppesen\Common\TerminalCharts.0.0 rmdir /s /q C:\ProgramData\Jeppesen\Common\TerminalCharts.alt.0 rmdir /s /q C:\ProgramData\Jeppesen\Common\TerminalChartsTemp ; @echo ofF ; CLS ; REGEDIT.EXE /S "%~f0" ; EXIT [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Jeppesen\JeppView for Windows\Paths] "CommonHidden"="C:\\ProgramData\\Jeppesen\\Common\\" "C2E_config"="C:\\ProgramData\\Jeppesen\\Common\\C2E4\\Config\\" "C2E_data"="C:\\ProgramData\\Jeppesen\\Common\\C2E4\\Data1\\" "ShapeData"="C:\\ProgramData\\Jeppesen\\Common\\C2E4\\Cultural\\" "TerrainData"="C:\\ProgramData\\Jeppesen\\Common\\TerrainData\\" "Themes"="C:\\ProgramData\\Jeppesen\\JeppView for Windows\\Themes\\" "Logs"="C:\\Users\\Public\\Documents\\Jeppesen\\JeppView for Windows\\Logs\\" "Bitmaps"="C:\\Users\\Public\\Documents\\Jeppesen\\JeppView for Windows\\Bitmaps\\" "TerminalCharts"="C:\\ProgramData\\Jeppesen\\Common\\TerminalCharts\\" [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Jeppesen\Jeppesen e-Link for Windows\Paths] "CommonHidden"="C:\\ProgramData\\Jeppesen\\Common\\" "C2E_config"="C:\\ProgramData\\Jeppesen\\Common\\C2E4\\Config\\" "C2E_data"="C:\\ProgramData\\Jeppesen\\Common\\C2E4\\Data1\\" "ShapeData"="C:\\ProgramData\\Jeppesen\\Common\\C2E4\\Cultural\\" "TerrainData"="C:\\ProgramData\\Jeppesen\\Common\\TerrainData\\" "Themes"="C:\\ProgramData\\Jeppesen\\Jeppesen e-Link for Windows\\Themes\\" "Logs"="C:\\Users\\Public\\Documents\\Jeppesen\\Jeppesen e-Link for Windows\\Logs\\" "Bitmaps"="C:\\Users\\Public\\Documents\\Jeppesen\\Jeppesen e-Link for Windows\\Bitmaps\\" "TerminalCharts"="C:\\ProgramData\\Jeppesen\\Common\\TerminalCharts\\" 

Solutions Collecting From Web of "多个命令在一个batch file中的问题"

您正在尝试使用批处理/ reg混合文件 。因此,您需要注释(从reg语法的角度来看)批处理部分; 并把注册表标签放在开头:

 Windows Registry Editor Version 5.00 ;@cls ;@echo ofF ;xcopy /y "C:\ProgramData\Jeppesen\Common\TerminalChartsTemp" "C:\ProgramData\Jeppesen\Common\TerminalCharts" ;rmdir /s /q C:\ProgramData\Jeppesen\Common\TerminalCharts.0.0 ;rmdir /s /q C:\ProgramData\Jeppesen\Common\TerminalCharts.alt.0 ;rmdir /s /q C:\ProgramData\Jeppesen\Common\TerminalChartsTemp ; REGEDIT.EXE /S "%~f0" ; EXIT /b 0 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Jeppesen\JeppView for Windows\Paths] "CommonHidden"="C:\\ProgramData\\Jeppesen\\Common\\" "C2E_config"="C:\\ProgramData\\Jeppesen\\Common\\C2E4\\Config\\" "C2E_data"="C:\\ProgramData\\Jeppesen\\Common\\C2E4\\Data1\\" "ShapeData"="C:\\ProgramData\\Jeppesen\\Common\\C2E4\\Cultural\\" "TerrainData"="C:\\ProgramData\\Jeppesen\\Common\\TerrainData\\" "Themes"="C:\\ProgramData\\Jeppesen\\JeppView for Windows\\Themes\\" "Logs"="C:\\Users\\Public\\Documents\\Jeppesen\\JeppView for Windows\\Logs\\" "Bitmaps"="C:\\Users\\Public\\Documents\\Jeppesen\\JeppView for Windows\\Bitmaps\\" "TerminalCharts"="C:\\ProgramData\\Jeppesen\\Common\\TerminalCharts\\" [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Jeppesen\Jeppesen e-Link for Windows\Paths] "CommonHidden"="C:\\ProgramData\\Jeppesen\\Common\\" "C2E_config"="C:\\ProgramData\\Jeppesen\\Common\\C2E4\\Config\\" "C2E_data"="C:\\ProgramData\\Jeppesen\\Common\\C2E4\\Data1\\" "ShapeData"="C:\\ProgramData\\Jeppesen\\Common\\C2E4\\Cultural\\" "TerrainData"="C:\\ProgramData\\Jeppesen\\Common\\TerrainData\\" "Themes"="C:\\ProgramData\\Jeppesen\\Jeppesen e-Link for Windows\\Themes\\" "Logs"="C:\\Users\\Public\\Documents\\Jeppesen\\Jeppesen e-Link for Windows\\Logs\\" "Bitmaps"="C:\\Users\\Public\\Documents\\Jeppesen\\Jeppesen e-Link for Windows\\Bitmaps\\" "TerminalCharts"="C:\\ProgramData\\Jeppesen\\Common\\TerminalCharts\\"