Skip to content

Instantly share code, notes, and snippets.

@gioxx
Created November 5, 2015 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gioxx/d005f055ebbdc0718b8b to your computer and use it in GitHub Desktop.
Save gioxx/d005f055ebbdc0718b8b to your computer and use it in GitHub Desktop.
Lo script VBS permette di specificare una diversa versione di Office 365 ProPlus (2013) da installare rispetto a quella presente nel sistema. Se questa è stata specificata (da finestra a video o direttamente da prompt dei comandi) scaricherà il necessario e lo installerà in base all'architettura di sistema (x86 o x64).
' Office 365 ProPlus (2013): Upgrade / Downgrade Version
' GSolone 2015 v 0.1
' Ultima modifica 05112015
'
' LO SCRIPT VA ESEGUITO COME AMMINISTRATORE MACCHINA O DI DOMINIO!
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set WNetwork = Wscript.CreateObject("Wscript.Network")
On Error Resume Next
if WScript.Arguments.Count = 0 then
'Richiesta numero di versione da installare
strVersion = InputBox("Office 365 ProPlus Upgrade-Downgrade Tool" & vbCR & "Lo script permette di installare una diversa versione di Office 365 ProPlus sulla macchina." & vbCR & vbCR & "VA ESEGUITO COME ADMIN LOCALI O DI DOMINIO!" & vbCR & vbCR & "Versione da installare (vuoto o clic su Annulla per uscire dallo script)" & vbCR, "OFC365PP: Upgrade Tool", "15.0.4737.1003")
else
'Se il numero di versione mi è stato passato da riga di comando, posso procedere direttamente
strVersion = Wscript.Arguments(0)
end if
if LEN(trim(strVersion)) = 0 Then
Messaggio = msgbox ("Non hai indicato la versione di Office da installare, termino lo script adesso.", vbCritical, "")
wscript.quit
else
Const Path = "winmgmts:root\cimv2:Win32_Processor='cpu0'"
'Sistema x86
if GetObject(Path).AddressWidth = 32 Then
WSHShell.run "cmd.exe /C ""%ProgramFiles%\Microsoft Office 15\ClientX86\officec2rclient.exe"" /update user updatetoversion=" & strVersion
end if
'Sistema x64
if GetObject(Path).AddressWidth = 64 Then
WSHShell.run "cmd.exe /C ""%ProgramFiles%\Microsoft Office 15\ClientX64\officec2rclient.exe"" /update user updatetoversion=" & strVersion
end if
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment