一个批处理文件中的多个命令出现问题

时间:2015-06-11 11:24:04

标签: windows batch-file

我试图以批处理方式编写补丁文件,并在完成后将其转换为exe。

我有2个批处理文件,当单独执行时工作得很好但是当我将它们加入其中一个批处理文件的第二部分(加入一个)不是完成任务(不添加注册表项)。

请你看看波纹管批次,让我知道我做错了什么(请注意这是特定应用)

提前感谢你

错误第1部分是删除目录和移动文件但是2dn没有创建注册表项请求帮助

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\\"

1 个答案:

答案 0 :(得分:0)

您正在尝试to use batch/reg hybrid file。因此,您需要使用;评论(从注册语法的角度来看)批处理部分,并将注册表标记放在开头:

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\\"