Welcome to Vista Banter. You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to ask questions and reply to others posts, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact support. |
|
Vista Administration, Accounts and Passwords Queries, comments and issues relating to the administration of Windows Vista. (microsoft.public.windows.vista.administration_accounts_passwords) |
|
LinkBack | Thread Tools | Display Modes |
|
|||
HTA's in Vista
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. |
|
|||
HTA's in Vista
Pete Gomersall wrote:
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: I have not even installed Vista so I cannot answer your question. However, I can say that the likelihood of anyone being able to help will be limited by your failure to define "doesn't work". What is the failure mode? Machine crash? Error message? Incorrect results? Acts as if it does something but nothing happens? -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup. |
|
|||
HTA's in Vista
All,
For those of you that cannot see the point of the question: What are the security differences between running HTA's on XP and Vista (as I suspect that the inherent difference is because of changes in Vista's security model - particularly IE 7's protected mode)? Code that works fine in XP doesn't work (as far as I can determine it is "just ignored" and fails silently without error, preventing any subsequent lines to run). For example this code in any HTA on Vista fails silently at the 3rd line, the second msgBox never executes and no errors are returned. msgBox "Blah, Blah!" strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") msgBox "Blah, Blah!" The same code in a standard .vbs works fine. Pete "Bob Barrows [MVP]" wrote in message ... Pete Gomersall wrote: 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: I have not even installed Vista so I cannot answer your question. However, I can say that the likelihood of anyone being able to help will be limited by your failure to define "doesn't work". What is the failure mode? Machine crash? Error message? Incorrect results? Acts as if it does something but nothing happens? -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup. |
|
|||
HTA's in Vista
"Pete Gomersall" wrote in message ... All, For those of you that cannot see the point of the question: What are the security differences between running HTA's on XP and Vista (as I suspect that the inherent difference is because of changes in Vista's security model - particularly IE 7's protected mode)? Code that works fine in XP doesn't work (as far as I can determine it is "just ignored" and fails silently without error, preventing any subsequent lines to run). For example this code in any HTA on Vista fails silently at the 3rd line, the second msgBox never executes and no errors are returned. msgBox "Blah, Blah!" strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") msgBox "Blah, Blah!" The same code in a standard .vbs works fine. Pete "Bob Barrows [MVP]" wrote in message ... Pete Gomersall wrote: 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: I have not even installed Vista so I cannot answer your question. However, I can say that the likelihood of anyone being able to help will be limited by your failure to define "doesn't work". What is the failure mode? Machine crash? Error message? Incorrect results? Acts as if it does something but nothing happens? -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup. I have never used Vista either But I would suggest that HTA scrips are not enabled by default |
Thread Tools | |
Display Modes | |
|
|