Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

updating office via script

Thread Tools
 
Search this Thread
 
Old 22 February 2005, 01:16 PM
  #1  
mike1210
Scooby Regular
Thread Starter
 
mike1210's Avatar
 
Join Date: Apr 2004
Location: Cardiff
Posts: 1,928
Likes: 0
Received 0 Likes on 0 Posts
Default updating office via script

I am trying to get a script to run in my place that updates office 2003 . The users dont have local admin rights and are restricted by a group policy which prevents them from changing the registry, background etc. I know this can be done via AD and msi files but they wont do it and i dont have domain admin rights . This is what i have so far, this will be called from the standard users script.

What we need to know is how do we install it as administrator using the run as command. How do you enter the password without having a user to input it? Any help would be appreciated.

rem Do you wish to insatll the office updates?
rem If not press Ctrl+C to quit

Pause
@echo off
runas /noprofile /user:localhost\administrator PasswordXXXX (i think this is the bit thats wrong)

@echo on
net localgroup "administrators" domain\security group /add

net use o: \\server\path\support\office03\updates
\\server\path\support\office03\updates\sp1.exe /q (service pack1)
\\server\path\support\office03\updates\update.exe /q (update)

Shutdown -r -t 360 (shuts machine down)

Last edited by mike1210; 22 February 2005 at 01:19 PM.
Old 23 February 2005, 08:19 PM
  #2  
Miles
Scooby Regular
 
Miles's Avatar
 
Join Date: Oct 1998
Location: The Granite City/Dallas, Tx.
Posts: 2,519
Likes: 0
Received 0 Likes on 0 Posts
Post

Originally Posted by mike1210
I am trying to get a script to run in my place that updates office 2003 . The users dont have local admin rights and are restricted by a group policy which prevents them from changing the registry, background etc. I know this can be done via AD and msi files but they wont do it and i dont have domain admin rights . This is what i have so far, this will be called from the standard users script.

What we need to know is how do we install it as administrator using the run as command. How do you enter the password without having a user to input it? Any help would be appreciated.

rem Do you wish to insatll the office updates?
rem If not press Ctrl+C to quit

Pause
@echo off
runas /noprofile /user:localhost\administrator PasswordXXXX (i think this is the bit thats wrong)

@echo on
net localgroup "administrators" domain\security group /add

net use o: \\server\path\support\office03\updates
\\server\path\support\office03\updates\sp1.exe /q (service pack1)
\\server\path\support\office03\updates\update.exe /q (update)

Shutdown -r -t 360 (shuts machine down)
I don't think the runas or similar command will execute as you expect, it'll spawn another process which will execute under the specified credentials - i.e. your script as it stands will not execute the following instructions under the other privileges of the other account.

Plus, perhaps more importantly, the runas can't take the password as a parameter - a 30 second Google turns up this which would seem to be useful.

So, you'd end up with a command/batch containing:
CPAU -u Administrator -p passwordXXXX -ex Update.bat

And Update.bat would contain
@echo on
net localgroup "administrators" domain\security group /add
net use o: \\server\path\support\office03\updates
\\server\path\support\office03\updates\sp1.exe /q (service pack1)
\\server\path\support\office03\updates\update.exe /q (update)
Shutdown -r -t 360

Incidentally depending on how you work it, punters with a bit of nouse would be able to get your admin password from the plain text batch file; which may not be the best.... There are various tools which can disguise the contents of a batch file.


Last edited by Miles; 23 February 2005 at 08:21 PM.
Old 23 February 2005, 08:24 PM
  #3  
Miles
Scooby Regular
 
Miles's Avatar
 
Join Date: Oct 1998
Location: The Granite City/Dallas, Tx.
Posts: 2,519
Likes: 0
Received 0 Likes on 0 Posts
Default

Incidentally, why do you map a network drive and then proceed to execute the updates from the UNC path?????
Old 26 February 2005, 09:16 PM
  #4  
mike1210
Scooby Regular
Thread Starter
 
mike1210's Avatar
 
Join Date: Apr 2004
Location: Cardiff
Posts: 1,928
Likes: 0
Received 0 Likes on 0 Posts
Default

Hi miles thanks for the reply

drive needs to be mapped as both the service pack and the patch are on a server which brings up a valid point as the staff dont have access rights to it doh, ill have to move it . At the moment i log in to the staffs pc and it brings down the updates that way as ive added a similar script into my login scipt. We have put a pause allowing us to cancel the script if the updates are already done on the machine. A bit of a potchy way to do it i admit, but i can do it on a few machines at a time and dont need any cd's or anything on me. cheers for the link too
Old 27 February 2005, 09:20 AM
  #5  
darlodge
Scooby Regular
 
darlodge's Avatar
 
Join Date: Oct 2001
Location: Lovely Lancing in West Sussex
Posts: 3,449
Likes: 0
Received 0 Likes on 0 Posts
Default

Is there not deployment software for Office built into the Office Resource Kit? There used to be.

Darren
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Brett-wv14
Subaru
17
06 October 2015 09:03 PM
An0n0m0us
Computer & Technology Related
0
28 September 2015 09:58 PM
MightyArsenal
Wheels, Tyres & Brakes
6
25 September 2015 08:31 PM
JackClark
Computer & Technology Related
3
18 September 2015 11:19 PM



Quick Reply: updating office via script



All times are GMT +1. The time now is 11:12 AM.