0

所以基本上我有这个批处理文件,当人们下载程序时,它将成为安装程序。但即使文件和所有内容都已经存在,它仍然告诉我“找不到指定的文件 - 0 个文件已复制”。

这是代码

@echo off
@echo copyright Maximillian Kasharkov, 2013
@echo Installation of Chrome-d will proceed. Do you want to continue?
pause
@echo This version of Chrome-d includes many improvements such as:
@echo Browsing speed increased by 5%
@echo Better security of sessions
@echo Slightly more lightweight
@echo Takes up lesser resources, better for older computers
@echo More fun :D
@echo Please wait while Chrome-d installs on your computer
@echo copying for 64 bit possibilities
@echo copying chrome-d_x64.exe
@echo ...
xcopy "%~dp0\chrome.exe" "C:\Program Files (x86)\Google\Chrome\Application" /c /q /i /e /y
xcopy "%~dp0\chrome1.exe" "C:\Program Files (x86)\Google\Chrome\Application" /c /q /i /e /y
xcopy "%~dp0\start.bat" "C:\Program Files (x86)\Google\Chrome\Application" /c /q /i /e /y
@echo copying LAYERS directory
@echo ...
xcopy "%~dp0\LAYERS" "C:\Program Files (x86)\Google\Chrome\Application" /c /q /i /e /y
@echo copying Library directory
@echo ...
xcopy "%~dp0\Library" "C:\Program Files (x86)\Google\Chrome\Application" /c /q /i /e /y
@echo creating shortcut on desktop
@echo ...
@echo d | xcopy "%~dp0\chrome-d 64.lnk" "%userprofile%\desktop" /c /q /i /e /y
@echo removing ghost copies of LAYERS and Library folders on desktop, sorry for the bug
@echo ...
rmdir /s /q "%USERPROFILE%\Desktop\LAYERS"
rmdir /s /q "%USERPROFILE%\Desktop\Library"
@echo copying for 32 bit possibilites
@echo copying chrome.exe
@echo ...
xcopy "%~dp0\chrome.exe" "C:\Program Files\Google\Chrome\Application" /c /q /i /e /y
@echo copying LAYERS directory
@echo ...
mkdir C:\Program Files\Google\Chrome\Application\LAYERS
xcopy "%~dp0\LAYERS" "C:\Program Files\Google\Chrome\Application" /c /q /i /e /y
@echo copying Library directory
@echo ...
mkdir C:\Program Files\Google\Chrome\Application\Library
xcopy "%~dp0\Library" "C:\Program Files\Google\Chrome\Application" /c /q /i /e /y
@echo creating shortcut on desktop
@echo ...
xcopy "%~dp0\chrome-d.lnk" "%userprofile%\desktop" /c /q /i /e /y
xcopy "%~dp0\chrome-d 64.lnk" "%userprofile%\desktop" /c /q /i /e /y
@echo removing ghost copies of LAYERS and Library folders on desktop, sorry for the bug
@echo ...
rmdir /s /q "%USERPROFILE%\Desktop\LAYERS"
rmdir /s /q "%USERPROFILE%\Desktop\Library"
pause
@echo Chrome-d is done :)
@echo  
@echo  
@echo To launch the new and more awesome version of chrome-d, just click the shortcut on your desktop.
@echo Please remember to manually add the shortcut to the windows taskbar (the panel at the top or bottom of your computer)
@echo  
@echo Thank you for trying out chrome-d! :D
@echo Have a nice day ahead!
pause

我不明白代码有什么问题,文件和文件夹都已经在那里了。LAYERS 和 Library 是同一个文件夹中的一个目录,其他所有内容都在那里,不在任何子文件夹中。

有人可以帮忙吗?

我指的文件夹的屏幕截图:http: //postimg.org/image/pnqykv7tl/

注意:64 位(前半部分)不应该工作,因为我在 32 位 com 上进行测试,但在 32 位 com 上它也不起作用

4

1 回答 1

2
xcopy "%~dp0\chrome.exe"

xcopy不喜欢\\ 文件名前的双反斜杠。全部更改

xcopy "%~dp0\"

xcopy "%~dp0"
rem example: xcopy "%~dp0chrome.exe"

具有讽刺意味的是,如果它出现在路径名中,这不是问题,例如。xcopy "%~dp0\Library\chrome.exe"

于 2013-06-23T07:17:28.720 回答