Script to re-activate Office 2010 after shipping new image (altiris 6.9)
I have just added Office 2010 to a lab image, and now have to re-activate it everytime I reimage each machine. I guess it's no surprise, but I have learned that this is by MS design. I have been able to accomplish this manually on a newly imaged machine by;
1) logging on administratively 2) opening CMD window 3) cd ProgramFiles\Microsoft Office\Office14\ 4) cscript ospp.vbs /act 5) logging off
I would love to script this for the final step in my deployment of a win7 machine. I am, however, script-challenged. Can you help me do this?
Answers (3)
Run ospp.vbs from Office14 folder with /act option as a vbscript
something like this should do: (untested)
Dim oFS, oShell, path, ret
Set oShell = WScript.CreateObject("WScript.Shell")
Set oFS = Wscript.CreateObject("Scripting.FileSystemObject")
path = "c:\Program Files\Microsoft Office\Office14\ospp.vbs"
ret = -1 'return -1 if the vbs is not found
if oFS.FileExists(path) then
ret = oShell.Run("cscript.exe " & chr(34) & path & chr(34) & " /act", 1)
End If
Wscript.Quit(ret) 'return the exit code of ospp.vbs if executed
Hi and thanks for your answers. I have been trying to get some consistency of results before writing again, and I can say that
start /wait cscript "c:\program files\microsoft office\office14\ospp.vbs" /act
did work about 1/2 the time as I worked on both laptop carts and wired labs. Sometimes I got an error message that suggested that the ospp.vbs hadn't started yet, and even said to first run ospp.vbs" /osppsvcrestart
so in my script-challenged way, I used the script
start /wait cscript "c:\program files\microsoft office\office14\ospp.vbs" /osppsvcrestart
start /wait cscript "c:\program files\microsoft office\office14\ospp.vbs" /act
It worked about 50 percent of the time still. Is there a better way to structure that script?
Thanks,
Bob
Comments:
-
Bob- can you let me know where you placed the script above? (i.e. user config > scripts < start-up or computer confi > scripts < logon? - sagunseanchetry 10 years ago