当路径在目录中有括号()时,Xcopy 将不起作用

当路径在目录中有括号()时,Xcopy 将不起作用

当路径在目录中有括号 () 时,Xcopy 将不起作用,有什么解决方法吗?

SET ProgFiles_86=%ProgramFiles(x86)% SET Program_name_64=%ProgramFiles%\Path\Program name (64 Bit)\File.dll SET Program_name_32=%ProgramFiles%\Path\Program_name\File.dll ::SET Program_name_86=%ProgFiles_86%\Path\Program_name\File.dll

IF NOT EXIST "%Program_name_64%" (echo Skipping %Program_Dir_86% -- NO DIR) ELSE (xcopy /t /U /r /h /l /f /i /s /y "64bit.DLL" "%ProgramFiles%\Path\Program_name (64)\64bit.DLL")

我甚至尝试过

:ProgFiles64Root IF NOT "%Program_name_64%"=="" echo Skipping %Program_name_64% -- NO DIR IF NOT "%Program_name_64%"=="" GOTO ProgFilesRoot xcopy /t /U /r /h /l /f /i /s /y "64bit\amtlib.dll" "%ProgramFiles%\Path\Program name (64 Bit)\File.dll" :ProgFilesRoot IF NOT "%Program_name_32%"=="" echo Skipping %Program_name_32% -- NO DIR IF NOT "%Program_name_32%"=="" GOTO ProgFiles_86Root xcopy /t /U /r /h /l /f /i /s /y "32bit\amtlib.dll" "%ProgramFiles%\Path\Program_name\File.dll" :ProgFiles_86Root IF NOT "%Program_name_86%"=="" echo Skipping %Program_name_86% -- NO DIR IF NOT "%Program_name_86%"=="" GOTO notProgFiles86Root xcopy /t /U /r /h /l /f /i /s /y "32bit\amtlib.dll" "%ProgFiles_86%\Path\Program_name (86 Bit)\File.dll" :notProgFiles86Root

我昨晚和今天尝试过谷歌搜索,但是没有人发布过这个问题,我所找到的只是一个针对 %ProgramFiles(x86)% 的 slochion,你可以在批处理中看到它,这很有帮助,但对其他目录执行此操作却没有帮助。

相关内容