I am trying to write a batch file that will take a version of Office XP and install another version.
I am able to do both.
My problem is that i dont what the installation to happen if the Uninstallation did not happen.
Pls let me know if their is a way to check if the command was successful.
The i am using is provided below:
\\ *Ms Office XP Unstallation Command Here*
@echo off
echo ................
timeout 120
cls
\\ *MS Office XP installation Command Here*
exit
Help With Batch File
Moderator: DosItHelp
-
- Posts: 233
- Joined: 21 Nov 2010 08:07
- Location: At My Computer
Re: Help With Batch File
normally office will just upgrade what you have, what version of office
are you uninstalling?, also ms has a officescrub.vbs file that you could call
from your batch then proceed with the new install ..
are you uninstalling?, also ms has a officescrub.vbs file that you could call
from your batch then proceed with the new install ..
Re: Help With Batch File
I am unstalling Office XP professional and installing Office XP standard version.
So I have to Unstall XP professional first.
So I have to Unstall XP professional first.
Re: Help With Batch File
Check if the installer or uninstaller returns an errorlevel result code.
You can then use the errorlevel to determine what to do.
uninstall command
if not errorlevel 1 (
install commands
)
You can then use the errorlevel to determine what to do.
uninstall command
if not errorlevel 1 (
install commands
)
-
- Posts: 233
- Joined: 21 Nov 2010 08:07
- Location: At My Computer
Re: Help With Batch File
Ok so you are doing a downgrade, have not used xp in years so cant vertify officexp registry location but
you could do the error level as suggested via a reg query as follows
Untested but you can get general idea
you could do the error level as suggested via a reg query as follows
Untested but you can get general idea
Code: Select all
@echo off
:Ck for O2Pro First
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductName% 1>> "%LogLocation%\%computername%.txt" 2>>&1
set Level=%ErrorLevel%
echo Error Level=%Level% >> "%LogLocation%\%computername%.txt"
if %Level%==0 (goto End) else (goto OfficeStd)
REM If 1 returned, the product was not found. Run setup here.
:OfficeStd
"%DeployStd%\setup.exe" 1>> "%LogLocation%\%computername%.txt" 2>>&1
echo %date% %time% Setup ended with error code %errorlevel%. >> "%LogLocation%\%computername%.txt"
REM If 0 or other was returned, the product was found or install was succesfull.
:End
Re: Help With Batch File
You were able to uninstall a version of office and install a new version of office in 3 minutes flat?
-
- Posts: 233
- Joined: 21 Nov 2010 08:07
- Location: At My Computer
Re: Help With Batch File
No Problem, just curious are you doing the Silent Install for Office Standard where its pre-activated etc.?