|
求大佬指点:
以下两段批处理,1运行不能创建快捷键,2运行可以创建快捷键,是什么原因造成的。
批处理1
@echo off
set "StartMenuPATH=%AllUsersProfile%\Microsoft\Windows\Start Menu\Programs\CorelDRAW Graphics Suite X7 (64-bit)"
IF NOT EXIST "%StartMenuPATH%\" MD "%StartMenuPATH%"
set "UserDesktop=C:\Users\Public\Desktop"
set "Program1=Program Files\Corel\CorelDRAW X7\Programs64\CorelDRW.exe"
set "shortcutname1=CorelDRAW X7 (64-Bit).lnk"
set "drives=C D E"
for %%d in (%drives%) do (
IF EXIST "%%%d:\%Program1%" (
Shortcut.exe /F:"%userDesktop%\%shortcutname1%" /A:C /D:"" /T:"%%d:\%Program1%">nul
Shortcut.exe /F:"%StartMenuPATH%\%shortcutname1%" /A:C /D:"" /T:"%%d:\%Program1%">nul
)
exit /b
批处理2
@echo off
set "StartMenuPATH=%AllUsersProfile%\Microsoft\Windows\Start Menu\Programs\CorelDRAW Graphics Suite X7 (64-bit)"
IF NOT EXIST "%StartMenuPATH%\" MD "%StartMenuPATH%"
SET "UserDesktop=C:\Users\Public\Desktop"
SET "Program1=Program Files\Corel\CorelDRAW X7\Programs64\CorelDRW.exe"
set "shortcutname1=CorelDRAW X7 (64-Bit).lnk"
IF EXIST "c:\%Program1%" Shortcut.exe /F:"%UserDesktop%\%shortcutname1%" /A:C /D:"" /T:"c:\%Program1%">nul
IF EXIST "c:\%Program1%" Shortcut.exe /F:"%StartMenuPATH%\%shortcutname1%" /A:C /D:"" /T:"c:\%Program1%">nul
IF EXIST "d:\%Program1%" Shortcut.exe /F:"%UserDesktop%\%shortcutname1%" /A:C /D:"" /T:"d:\%Program1%">nul
IF EXIST "d:\%Program1%" Shortcut.exe /F:"%StartMenuPATH%\%shortcutname1%" /A:C /D:"" /T:"d:\%Program1%">nul
IF EXIST "e:\%Program1%" Shortcut.exe /F:"%UserDesktop%\%shortcutname1%" /A:C /D:"" /T:"e:\%Program1%">nul
IF EXIST "e:\%Program1%" Shortcut.exe /F:"%StartMenuPATH%\%shortcutname1%" /A:C /D:"" /T:"e:\%Program1%">nul
exit /b
批处理3
想求个能达到以下功能的批处理:对注册表文件dreg.reg(文件比较大)里的所含相同字符进行替换并保存文件为ereg.reg
注册表文件dreg.reg有原有5段字符
(1) d:\\Program Files\\Corel\\CorelDRAW X7\\
(2) d?\\Program Files\\Corel\\CorelDRAW X7\\
(3) d:|Program Files|Corel|CorelDRAW X7|
(4) :6E,00,3B,00,31,00,3B,00,64,00,3A,00,5C,00,70,00,
(5) :64,00,3A,00,5C,00,70,00,72,00,6F,00,67,00,72,00,
要依次替换的字符段
(1) e:\\Program Files\\Corel\\CorelDRAW X7\\
(2) e?\\Program Files\\Corel\\CorelDRAW X7\\
(3) e:|Program Files|Corel|CorelDRAW X7|
(4) :6E,00,3B,00,31,00,3B,00,65,00,3A,00,5C,00,70,00,
(5) :65,00,3A,00,5C,00,70,00,72,00,6F,00,67,00,72,00, |
|