|
论坛有人做过。
@echo off
title WMP精简版安装(Pseudo 07.09.08)
SET Var0=%0
IF '^%Var0:~0,1%'=='^"' SET Var0=%Var0:~1,-1%
FOR /f "delims=" %%I in ("%Var0%") do Set TP=%%~dpI
SET TP=%TP:~0,-1%
setX.exe PATH "%PATH%;%TP%" -m
FOR /F %%i In ('DIR *.DLL /B /A-D /ON') DO REGSVR32 /S %%i
REGSVR32 /S l3codeca.acm
call :注册WMP
if not exist PECMD.EXE (
if not exist %SystemRoot%\System32\PECMD.EXE goto :L1
)
PECMD.EXE LINK !%USERPROFILE%\桌面\Windows Media Player,%TP%\wmplayer.exe,/prefetch:1
pecmd.exe mess 安装完成。\n桌面快捷方式已创建。\n3秒后自动关闭本对话框。@完成
:L1
exit
:注册WMP
call :双斜杠 "%TP%"
set DBL_TP=%doubleSlash%
call :getShortName "%TP%"
set S_TP=%shortName%
call :双斜杠 "%S_TP%"
set DBL_S_TP=%doubleSlash%
call :双斜杠 "%UserProfile%"
set DBL_UserProfile=%doubleSlash%
set SrcFile=MP10Setup_CN.reg
if not "%DBL_UserProfile%"=="X:\\Documents and Settings\\Default User" (
strrpc.exe /I "X:\\Documents and Settings\\Default User" "%DBL_UserProfile%" /S:"%SrcFile%" >"%SystemRoot%\System32\tempwmp1.reg"
set SrcFile=%SystemRoot%\System32\tempwmp1.reg
)
if not "%DBL_S_TP%"=="C:\WMP10L~1" (
strrpc.exe /I "C:\WMP10L~1" "%DBL_S_TP%" /S:"%SrcFile%" >"%SystemRoot%\System32\tempwmp2.reg"
set SrcFile=%SystemRoot%\System32\tempwmp2.reg
)
if not "%DBL_TP%"=="C:\\WMP10Lite" (
strrpc.exe /I "C:\\WMP10Lite" "%DBL_TP%" /S:"%SrcFile%" >"%SystemRoot%\System32\tempwmp3.reg"
set SrcFile=%SystemRoot%\System32\tempwmp3.reg
)
REGEDIT /S "%SrcFile%"
del /Q /F "%SystemRoot%\System32\tempwmp*.reg"
goto :eof
:getShortName
set shortName=%~s1
goto :eof
:双斜杠
rem return doubleSlash
for /f "eol=; tokens=1,* delims=\" %%i in ("%~1") do (
set double=%%i
set remain=%%j
)
:repeat
if "%remain%"=="" (
set doubleSlash=%double%
goto :eof
)
for /f "eol=; tokens=1,* delims=\" %%i in ("%remain%") do (
set double=%Double%\\%%i
set remain=%%j
)
goto :repeat |
|