有適過下面的批次檔
可是會出現 不應該有%%a
@Echo off
CD %cd%
:VerInstall
for /f "tokens=12,*" %%a in ('wmic product list system ^| Find /I "SkypeT"') do (
if Errorlevel = 0 (
Echo Skype is installed! )
if Errorlevel = 1 ( Echo Skype is not installed, proceding to the installation!
Ping localhost -n 7 >nul
goto :Reinstall )
)
:Force
echo We are killing the proccess... Please do not use the application during this process!
Ping localhost -n 7 > nul
taskkill /F /FI "STATUS eq RUNNING" /IM APP* /T
echo The task was killed with success! Uninstalling...
Ping localhost -n 7 > nul
:Uninstall
cls
for /f "tokens=12,*" %%a in ('wmic product list system ^| Find /I "SkypeT"') do (
set %%a=%%a: =%
msiexec.exe /x %%a /passive /norestart
)
沒有其它需求的話這樣就可以了
<pre class="c" name="code">
@Echo off
for /f "tokens=12,*" %%a in ('wmic product list system ^| Find /I "Skype(TM)"') do msiexec.exe /x %%a /passive /norestart
另外
a22063821提到:
出現 不應該有%%a
我這測試沒有問題,你可以試試把
a22063821提到:
Echo Skype is installed!
改成
a22063821提到:
Echo Skype is installed^!
這裡
a22063821提到:
Find /I "SkypeT"'
可能要確認一下是這個字串嗎?