|
3#
楼主 |
发表于 2023-11-7 16:11:51
|
只看该作者
主要是想放在这个批处理前面代替手动输入文件路径的步骤,虽然基本功能达到了,但批处理东抄抄、西抄抄,总感觉乱七八糟的。怎么上传不了txt文件。
@echo off & pushd %~dp0
%Windir%\System32\FLTMC.exe >nul 2>&1 || (
ECHO CreateObject^("Shell.Application"^).ShellExecute "%~f0", "%1", "", "runas", 1 > "%TEMP%\AdminRun.vbs"
ECHO CreateObject^("Scripting.filesystemobject"^).DeleteFile ^(WScript.ScriptFullName^) >> "%TEMP%\AdminRun.vbs"
%Windir%\System32\CSCRIPT.exe //Nologo "%TEMP%\AdminRun.vbs"
Exit /b
)
mode con cols=120 lines=40
:softpath
echo 输入软件路径如D:\Program Files\Corel\CorelDRAW 2020\Programs64
echo 通过桌面快捷方式打开文件位置,在地址栏中选择地址右键复制,到批处理窗口右键粘贴,回车进入插件选择菜单。
echo=
set /p softpath=请输入CorelDRAW软件所在路径:
echo=
for %%d in ("%softpath:~0,-1%") do set "Program1=%%~dpd"
for %%i in ("%softpath%") do set "FileName=%%~nxi"
set "Program1=%Program1:~0,-1%"
:softx64x86
echo 您输入的CorelDRAW软件所在路径为:%Program1%\%FileName%
echo=
if "%FileName%"=="Programs64" goto :x64
if "%FileName%"=="Programs" goto :x86
echo 路径输入错误,请回车重新输入。
pause
goto :soft
path
:x64
set "File=x64"
goto :choice_menu
:x86
set "File=x86"
goto :choice_menu
:choice_menu
echo 请选择需要安装的插件:
echo=
echo 1. 安装魔镜插件 (支持x4-2022)
echo=
echo 2. 安装CD印前小精灵2.0(支持x4-2022,x86版要先从C:\Windows下导入工作区,工具栏勾选CD小精灵。)
echo=
echo 3. 安装ymxkDoc 23.1.6.2插件 (在工具栏勾选ymxkDoc。只支持X7及以上版本)
echo=
echo 4. 安装YG增强插件、eCut6插件与缩略图显示插件
echo=
echo 5. 安装win10显示菜单插件 (X4 X5显示菜单插件)
echo=
echo 6. 返回重新输入CorelDRAW软件所在路径
echo=
set /p "choice=请输入数字选项(1-6): "
if %choice%==1 (
set "source=tools\hicetea"
set "File2=hicetea.7z"
) else if %choice%==2 (
set "source=tools\YangCD"
set "File2=YangCD.7z"
) else if %choice%==3 (
set "source=tools\ymxkDoc"
set "File=ymxkDoc"
goto :choice_a
) else if %choice%==4 (
goto :choice_c
) else if %choice%==5 (
set "source=tools\MenuPatch"
set "File=x86"
goto :choice_b
) else if %choice%==6 (
goto :softpath
) else (
echo 按回车返回本菜单,重新输入。
pause >nul
goto :choice_menu
)
REM 解压安装插件*.7z文件
7za.exe x -y "%cd%\%source%\%File2%" -oC:\
7za.exe x -y "%cd%\%source%\%File%.7z" "-o%Program1%"
echo 按任意键返回插件选择菜单或者关闭退出
pause >nul
goto :choice_menu
:choice_a
REM 解压安装插件*.7z文件
7za.exe x -y "%cd%\%source%\%File%.7z" "-o%Program1%\%FileName%"
echo 按任意键返回插件选择菜单或者关闭退出
pause >nul
goto :softx64x86
:choice_b
REM 解压安装插件*.7z文件
7za.exe x -y "%cd%\%source%\%File%.7z" "-o%Program1%"
echo 按任意键返回插件选择菜单或者关闭退出
pause >nul
goto :softx64x86
:choice_c
set /p ver=请输入CorelDRAW软件版本号(X3-X8或2017-2022):
if /i %ver%==X3 goto :choice_d
if /i %ver%==X4 goto :choice_d
if /i %ver%==X5 goto :choice_d
if /i %ver%==X6 goto :choice_d
if /i %ver%==X7 goto :choice_d
if /i %ver%==X8 goto :choice_d
if /i %ver%==2017 goto :choice_d
if /i %ver%==2018 goto :choice_d
if /i %ver%==2019 goto :choice_d
if /i %ver%==2020 goto :choice_d
if /i %ver%==2021 goto :choice_d
if /i %ver%==2022 goto :choice_d
echo 输入错误,请重新输入(如X4)。
goto :choice_c
:choice_d
echo=
echo 1. 安装YG增强插件 (支持x4-2022,在设置窗口中点创建桌面快捷方式完成YG插件安装)
echo=
echo 2. 安装eCut6插件 (支持x3-2021,86位先从C:\eCut下导入相应工作区,工具栏勾选eCut6)
echo=
echo 3. 安装缩略图显示插件
echo=
echo 4. 返回上一级插件选择菜单
set "soft=CorelDRAW %ver%"
echo=
set /p "choice=请输入数字选项(1-4): "
if %choice%==1 (
set "source=tools\YG"
set "File2=YG.7z"
goto :choice_yg
) else if %choice%==2 (
set "source=tools\other"
set "File2=eCut.7z"
set "File3=%soft%\eCutx86x64.7z"
) else if %choice%==3 (
start /wait %cd%\tools\other\"%soft%"\ShellExt.msi /quiet
goto :choice_d
) else if %choice%==4 (
goto :softx64x86
) else (
echo 按回车返回本菜单,重新输入。
pause >nul
goto :choice_d
)
REM 解压安装插件*.7z文件
7za.exe x -y "%cd%\%source%\%File2%" -oC:\
7za.exe x -y "%cd%\%source%\%File3%" "-o%Program1%"
echo 按任意键返回本插件选择菜单或者关闭退出
pause >nul
goto :choice_d
:choice_yg
REM 解压安装插件*.7z文件
7za.exe x -y "%cd%\%source%\%File2%" -oC:\
7za.exe x -y "%cd%\%source%\%File%.7z" "-o%Program1%"
set "sourcecfg=C:\YG\%File%.cfg"
set "new_Filename=%Program1%\%FileName%\CorelDRW.exe"
set "new_ShortcutName=%soft% YG"
set "new_RunningTime=0"
set "new_ReturnNumOfSeconds=100"
set "new_DateTime=18-08-2018 00:00:00"
set "tempfile=%temp%\tempfile.cfg"
echo [General] > "%tempfile%"
echo Filename=%new_Filename% >> "%tempfile%"
echo Params= >> "%tempfile%"
echo ShortcutName=%new_ShortcutName% >> "%tempfile%"
echo StartIn= >> "%tempfile%"
echo RunningTime=%new_RunningTime% >> "%tempfile%"
echo ImmediateMode=0 >> "%tempfile%"
echo ReturnToCurrTime=1 >> "%tempfile%"
echo ReturnNumOfSeconds=%new_ReturnNumOfSeconds% >> "%tempfile%"
echo DateTimeMode=1 >> "%tempfile%"
echo AddTimeUnit=4 >> "%tempfile%"
echo AddTimeValue=-1 >> "%tempfile%"
echo DateTime=%new_DateTime% >> "%tempfile%"
echo WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 82 01 00 00 BF 00 00 00 D3 03 00 00 40 02 00 00 >> "%tempfile%"
move /y "%tempfile%" "%sourcecfg%" >nul 2>&1
start "" "C:\YG\%File%.exe"
echo 点击创建桌面快捷方式完成YG插件安装,点击关闭,然后运行带YG命名的corel快捷键即可。
echo 按任意键返回本插件选择菜单或者关闭退出
pause >nul
goto :choice_d
|
|