jxhzhang
Content Type
Profiles
Forums
Events
Posts posted by jxhzhang
-
-
Yes it fixed the issue. Thank you!
So I've looked around for string manipulation in batch files but the results came up pretty dry. Any idea on how to change the UninstallString from "MsiExec.exe /I{AC76BA86-7AD7-1033-7B44-A71000000002}" to "MsiExec.exe /x {AC76BA86-7AD7-1033-7B44-A71000000002} -qb"?
Cheers!
0 -
Here's a quick stab at what I think you want:
@Echo off&Setlocal
Set "kb_=HKLM\SOFTWARE\Adobe\Acrobat Reader"
Set "ke_=Installer\{AC76BA86-7AD7-"
Set "uk_=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
For /f "tokens=2 delims={" %%# In (
'Reg query "%kb_%" /s^|find "%ke_%" 2^>Nul') Do Call :_ {%%#
Endlocal&Goto :Eof
:_
Set "t_=%uk_%\%1"
Reg query %t_% /v DisplayVersion|Findstr "7.0.9 7.1.0">Nul 2>&1||(Set "t_="
Goto :Eof)
For /f "tokens=3 delims= " %%# In (
'Reg query %t_% /v UninstallString') Do Start "" /wait "%%~#"The intention is that it'll uninstall either version 7.0.9 or 7.1.0 if either one of them exist!
Let us know how it goes.
Note
Remember when you paste it in that delims=<tab>" in the last 'For loop'.
Thank you for a quick response! Took me a bit of time to understood what the code does. You are taking the UninstallString from registry and running it, but I need it to be silent (using the /x and end with -qb instead of /i). Also when I ran the batch you've created, I get this
Not sure why it gives you that error because I executed the UninstallString with Run and works fine. So is it possible to do the batch above and silent uninstall (with progress window)? Thanks again!
0 -
Hello, I'm new but I'm trying to do the exact same thing but there is a twist to this.
I'm trying to do an uninstall for Adobe Reader 7.0.9 or Reader 7.1.0. The thing is 7.0.9 uses this key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1033-7B44-A70900000002} while 7.1.0 use this HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1033-7B44-A71000000002}. How would I check if 7.0.9 doesn't exist then check 7.1.0?
Right now REG would return an error while checking for 7.0.9 (because it doesn't exist on a machine with 7.1.0 installed). How would I go about to get around that?
Thanks,
James
0
batch file that check version in registry
in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Posted
Well I feel a bit dumb
You are great help. Thanks again!