Computer Startup script not running on Windows 7
Weird problem here.
I have a vbs script that installs Office 2010 through GPO computer startup script. The script works excellent on Windows XP during startup. But on windows 7 nothing happens.
I have tried to run it manually on Windows 7 and then everything works fine.
Tried to make a simple batch file startup script (dir c:\ >> c:\tm\dirlist.txt) - this works fine.
Any ideas what it could be?
Option explicit
Dim strComputer, objWMIService, colSettings, objProcessor
Dim WSHShell,objEnVar,oExec
Set WSHShell = CreateObject("WScript.Shell")
Set objEnVar = WSHShell.Environment("PROCESS")
strComputer = "."
If KeyExists("HKLM\SOFTWARE\Microsoft\Office\14.0\common\ProductVersion\") Then
'MsgBox "Office 2010 er allerede installeret - EXIT"
Else
'MsgBox "Not Found"
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery ("SELECT * FROM Win32_Processor")
For Each objProcessor In colSettings
select case objProcessor.DataWidth
case "64"
msgbox objProcessor.DataWidth & "-bit" & vbCrLf & "Operating System: " & objProcessor.AddressWidth & "-bit"
Set oExec = WSHShell.Exec( Chr(34) & "\\domainname.loc\msipackages$\Office2010ProPlus\" & objProcessor.DataWidth &"bit\setup.exe" & Chr(34) & " /adminfile \\domainname.loc\msipackages$\Office2010ProPlus\" & objProcessor.DataWidth &"bit\domainnameCustom64bit.msp")' wait until finished
Do While oExec.Status <> 1
WScript.Sleep 100
Loop
case "32"
msgbox objProcessor.DataWidth & "-bit" & vbCrLf & "Operating System: " & objProcessor.AddressWidth & "-bit"
Set oExec = WSHShell.Exec( Chr(34) & "\\domainname.loc\msipackages$\Office2010ProPlus\" & objProcessor.DataWidth &"bit\setup.exe" & Chr(34) & " /adminfile \\domainname.loc\msipackages$\Office2010ProPlus\" & objProcessor.DataWidth &"bit\domainnameCustom32bit.msp")' wait until finished
Do While oExec.Status <> 1
WScript.Sleep 100
Loop
' Fjern registrering af Office 2010 popup
Set oExec = WSHShell.Exec( Chr(34) & "%systemroot%\system32\cscript.exe" & Chr(34) & " %programfiles%\microsoft office\office14\ossp.vbs /act")'
Do While oExec.Status <> 1
WScript.Sleep 100
Loop
case else
'Msgbox "Vi kan ikke kontrollere hvillken processortype version der anvendes"
end select
Next
End If
msgbox "Installation er afsluttet"
Function KeyExists(key)
Dim objShell
On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
objShell.RegRead (key)
Set objShell = Nothing
If Err = 0 Then KeyExists = True
End Function
September 27th, 2011 4:00pm
Hi MrStaun,
Do you turn UAC on?
Please refer to this KB:
http://support.microsoft.com/kb/937624/en-us
Regards,
MiyaThis posting is provided "AS IS" with no warranties, and confers no rights. | Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer
your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
September 29th, 2011 6:02am