P
Pete Gomersall
Hi,
Does anyone know why HTA code that previously worked in XP doesn't in Vista?
For example this code taken from the HTA Developers Center on Script Center
works fine in XP and also on Vista if called within a .vbs file however it
doesn't work in Vista when used in a HTA:
Sub GetOSVersion
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
Msgbox objOperatingSystem.Caption & " " & _
objOperatingSystem.Version
Next
End Sub
I suspect a change in the security model for the interaction of mshta and IE
7 (protected mode etc) but I am guessing here.
It would be great if someone from MSFTcould provide a link to documentation
on HTA's and Vista.
Does anyone know why HTA code that previously worked in XP doesn't in Vista?
For example this code taken from the HTA Developers Center on Script Center
works fine in XP and also on Vista if called within a .vbs file however it
doesn't work in Vista when used in a HTA:
Sub GetOSVersion
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
Msgbox objOperatingSystem.Caption & " " & _
objOperatingSystem.Version
Next
End Sub
I suspect a change in the security model for the interaction of mshta and IE
7 (protected mode etc) but I am guessing here.
It would be great if someone from MSFTcould provide a link to documentation
on HTA's and Vista.