View unanswered posts | View active topics It is currently 01 Nov 2014 00:00



Post new topic Reply to topic  [ 8 posts ] 
Help With Batch File 
Author Message

Joined: 20 Jun 2012 03:51
Posts: 3
Post Help With Batch File
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


20 Jun 2012 04:03
Profile

Joined: 21 Nov 2010 08:07
Posts: 225
Location: At My Computer
Post 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 ..


20 Jun 2012 04:42
Profile

Joined: 20 Jun 2012 03:51
Posts: 3
Post 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.


20 Jun 2012 05:05
Profile

Joined: 10 Feb 2012 02:20
Posts: 4331
Post 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
)


20 Jun 2012 05:37
Profile

Joined: 21 Nov 2010 08:07
Posts: 225
Location: At My Computer
Post 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

Code:
@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


20 Jun 2012 06:17
Profile

Joined: 20 Jun 2012 03:51
Posts: 3
Post Re: Help With Batch File
Thanks That works!


20 Jun 2012 06:20
Profile

Joined: 23 Dec 2011 13:59
Posts: 1952
Post 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?


20 Jun 2012 06:40
Profile

Joined: 21 Nov 2010 08:07
Posts: 225
Location: At My Computer
Post Re: Help With Batch File
No Problem, just curious are you doing the Silent Install for Office Standard where its pre-activated etc.? 8)


20 Jun 2012 07:31
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Forum style by Vjacheslav Trushkin for Free Forums/DivisionCore.