Mit script er som følger:
'»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
'FileName : Afinstaller Office2003.vbs
'Version : 2.1.0
'Description : Script for settings that should be applied only once
'Author : Jens Tønnesen (JT) -
'CreationDate : 05-09-2009
'Changed : [DATE\NAME\INITIALS]
'««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
'----------------------------------------------------------------------------------------
'----------------------------------------------------------------------------------------
'»»» Object Declarations «««
On Error Resume Next
Set WshShell=WScript.CreateObject("WScript.Shell")
set fso=CreateObject("Scripting.FileSystemObject")
set WshNetwork = CreateObject("WScript.Network")
Set WMI = GetObject("WinMgmts:")
'----------------------------------------------------------------------------------------
'»»» Variables «««
ScriptName = WScript.ScriptFullName '»»» Gets Full UNC-path of current script
InstPath = fso.GetParentFolderName(ScriptName) '»»» Gets path of parent folder for current script
TOPeXPressPath = fso.GetParentFolderName(InstPath) '»»» Gets path of parent folder for current script
WinPath = WshShell.ExpandEnvironmentStrings("%WinDir%") '»»» Gets path to Windows dir
ProfPath = WshShell.ExpandEnvironmentStrings("%UserProfile%") '»»» Gets path to UserProfile
DomainLogonserver = WshShell.ExpandEnvironmentStrings("%Logonserver%")
AppData = WshShell.RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\AppData")
UserID = WshNetwork.UserName
PC = WshNetwork.computername '»»» Gets the Current PC CoomputerName
Dim AdsPath, Userobj, FullNameUser
AdsPath = WshNetwORk.UserDomain & "/" & WshNetwORk.UserName
Set Userobj = GetObject("
WinNT://" & AdsPath & ",user")
FullNameUser = Userobj.FullName
UserIDTemp = WshNetwork.UserName '»»» Gets the Current PC CoomputerName
PCTemp = WshNetwork.computername '»»» Gets the Current PC CoomputerName
UserID = UCase(UserIDTemp)
PC = UCase(PCTemp)
Version = "2" '»»» Change this number to +1 to run setting again
'----------------------------------------------------------------------------------------
'»»» RunCommands «««
file = "C:\Programmer\Microsoft Office\Office12\Winword.exe" ' change to match the file w/Path
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists(file) Then
'»»» START Exefiler «««
On Error Resume Next
RunCommand1 = "\\notes1\stdpc$\Apps\AppsOffice2007\setup.exe /adminfile office.MSP"
'DO
Err = WshShell.Run(RunCommand1,2,TRUE)
'Loop Until Err = 0
'»»» SLUT Exefiler«««
Else
End If
'----------------------------------------------------------------------------------------
'»»» EndScript «««
Function ENDJOB
Wscript.Quit
End Function
'----------------------------------------------------------------------------------------