web-dev-qa-db-ja.com

Windowsのアンインストールプログラムバッチはありますか?

コンピューターからアンインストールするプログラムがいくつかあります(Windows 7 64ビット)。

それを行うのに役立つバッチ\スクリプトはありますか?または、コントロールパネルから1つずつ実行する必要がありますか?

Windows 7がない場合、XPにこのようなものはありますか?

ありがとう、ドー。

9
Dor Cohen

私が知っているcmdには実際にはuninstallコマンドのようなものはありません。ただし、このregキーをクエリすることはできます

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

(64ビットマシンを使用している場合は、HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstallも確認する必要がある場合があります)

アンインストールするプログラムを見つけます。それぞれにUninstallString値があり、プログラムのアンインストーラーファイルへのパスを通知します。このファイルは、フルパスとファイル名を呼び出すことで実行できます。

アンインストーラーがたまたまmsiの場合、使用できます。

msiexec /uninstall /xを使用して、サイレントアンインストールします。これは、バッチでできることとほぼ同じです。

お役に立てれば!

13
Bali C

バリの答えを補足するには、次のコードを試してください...

@echo off
for /f "tokens=*" %%a in ('reg query hklm\software\Microsoft\Windows\CurrentVersion\Uninstall\ ^| find /I "%*"') do (
  for /f "tokens=1,2,*" %%b in ('reg query "%%a" /v UninstallString ^| find /I "UninstallString"') do (
    if /i %%b==UninstallString (
      echo %%d
    )
  )
)

慎重にテストしてください。次に、echoコマンドを削除します。

10
PA.

今朝私はこれを書いた。

@Echo off
Echo This is a batch file uninstallation program. 
Echo Run as administrator WMIC will not work. 
echo.
Echo The command [wmic product get name] will run.
Echo Looking up all installed programs...
echo. 
wmic product get name

 echo 1. First program
 echo 2. Second program
 echo 3. Third program
 echo 4. Fourth program
 echo 5. Fifth program
echo.
@echo Pick a number: 
echo. 
 choice /c:12345 

 if "%errorlevel%"=="1" wmic product where name="First program" call uninstall
 if "%errorlevel%"=="2" wmic product where name="Second program" call uninstall
 if "%errorlevel%"=="3" wmic product where name="Third program" call uninstall
 if "%errorlevel%"=="4" wmic product where name="Fourth program" call uninstall
 if "%errorlevel%"=="5" wmic product where name="Fifth program" call uninstall

Echo.
Echo.

@echo First method is done. I'll go into the alternate method. 

pause
Echo Get user input - program name?
Echo.
Echo This is an alternate method 
:input
set INPUT=
set /P INPUT=Uninstall which program?: %=%
if "%INPUT%"=="" goto input
echo Your input was: %INPUT%

echo.
echo.
Echo Uninstalling... 

echo The command [wmic product where name="%INPUT%" call uninstall] will run. 


wmic product where name="%INPUT%" call uninstall

@echo If there is "no instance" errors, then the program %INPUT% was uninstalled.

pause
4
George Gill

端末から直接wmicを使用します。 Microsoftのドキュメントを参照して、その他の使用方法を確認できます。

これはすばらしい出発点になります。

wmic product where vendor="Autodesk" call uninstall

上記の行を使用して、オートデスク製品をクリーンアンインストールします。

2
William Motta