4

I have a problem that just started at work recently and the network manager is certain he did not change anything with the group policy. Anyways, here is a detailed description of the problem.

My machine is Windows XP SP3, and I use IE8 to browse. We have McAffee anti-virus software that I am unable to configure. I use the following file to test...

<!DOCTYPE html>
<html>
  <head>
    <title>Javascript Test</title>
  </head>
  <body>
    <script type="text/javascript">
      document.write("<h1>PASS</h1>");
    </script>
    <noscript>
      <h1>FAIL</h1>
    </noscript>
  </body>
</html>

When I open this file from the C: drive, it fails every time. If I execute it anywhere else (local/remote web server or on a mapped network drive), it works just fine. When I am simply browsing the Internet, Javascript on web sites works just fine. It is only failing on files running from my C: drive. Additionally, I have had a couple other programmers in the department try this file on their C: drive, and it works fine for them. So I don't believe it is a group policy thing.

I need to fix this because I do extensive testing from my C: drive, and I am accustomed to doing so. I don't want to get into the habit of moving files to a different drive just to test.

Things I have tried:

  • Enabled "Allow Active Content to Run Files on My Computer" in Options | Advanced | Security
  • Enabled "Allow Active Scripting" in Options | Security | Custom Level
  • Verified that "Script" was not checked as disabled in Developer Toolbar
  • Added localhost to Trusted Sites in Options
  • Disabled McAffee completely (momentarily, with help from network admin)
  • Used an older DOCTYPE in my test HTML page
  • Re-installed IE8 completely
  • Ran regsvr32 on the JScript.dll
  • Slammed keyboard

I am sure that there is a setting somewhere that will fix this problem, possibly in the registry. I would not be surprised if it was related to the developer toolbar. At this point I do not know where else to look.

Can anyone help me resolve this problem?

EDIT: Regardless of the bounty, this issue is still ongoing.

9
  • well, it works just fine for me in WinXP/IE8 (as it does for your colleagues) so it's got to be a local problem (and i'm NOT using McAfee :). if you can't configure your security software, have a chat with the IT department.
    – Molly7244
    Jan 5, 2010 at 14:15
  • Why not just run it from your local web server? Why does it have to be run from your C: drive?
    – Mark
    Jan 5, 2010 at 14:39
  • 1
    @Molly we tried disabling McAffee completely. No luck. @Mark It doesn't have to. I want it to because it's easier for a quick and dirty test. And it's always worked before so I am very used to doing this. Jan 5, 2010 at 19:59
  • IE has always prompted me in the yellow information bar on top of the window to allow JavaScript from "My Computer" (apparently as it will grant access to local resources, which scripts from websites do not get; IE7 screen capture at img.skitch.com/20100106-khkek2wwscdxmak5x8k3y5gax3.png). So, it seems to me that on your computer the warning about running possibly dangerous scripts has disappeared? Maybe you can find something like "reset all warnings"? And in the IE7 options there's even a button to reset all IE settings? And can you collapse/expand local XML files in IE?
    – Arjan
    Jan 6, 2010 at 17:43
  • And did those other programmers not get that warning in the information bar either? (So: did the script run without any prompt on their computer?)
    – Arjan
    Jan 6, 2010 at 19:58

12 Answers 12

4

Open registry key

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\n

Where n is the zone index, where 0 means My Computer. This zone is not available in Internet Options. Set Value 1400 to 0 to enable Javascript.

4
+75

Have you tried to add a "Mark of the Web" in your HTML source?

Just add something like:

<!DOCTYPE html>
<!-- saved from url=(0021)http://www.google.com -->
<html>

A Mark of the Web is after the DOCTYPE tag, alone on a separate line, just before <html>.

See the MSDN documentation on Mark of the Web for full help.

13
  • Nice thought. It's still a workaround of course, but nice idea!
    – Arjan
    Jan 11, 2010 at 18:37
  • ...and that don't requre any change to your security policies, IE settings...
    – AlexV
    Jan 11, 2010 at 19:27
  • 1
    It works, but it is lame. Thanks :) Jan 11, 2010 at 20:20
  • 1
    Why it's lame? It's better by far than lowering security of your whole system for just one page (and sometimes it's not even possible). Mark of the Web are here for that and it's the best solution for this kind of "problem" IMO. If there is something lame, it's IE! :)
    – AlexV
    Jan 11, 2010 at 20:55
  • 1
    @kentaromiura: Just a year late, but since the OP problem only occurs when file:// is used, in that particular case it's a perrfectly suitable solution.
    – AlexV
    Feb 23, 2011 at 20:52
1

if the computer is subject to corporate security policies, you may consider setting up a virtual machine (e.g. with Virtual Box or MS Virtual PC) to test your java scripts.

Microsoft offers a variety of pre-activated virtual hard drives (they work with VirtualBox and VPC) with either Vista or XP and IE6, 7 and 8. Internet Explorer Application Compatibility VPC Images are free and the current set is valid until April 1, 2010.

7
  • 2
    I understand my work-around options, and I have several of them at-hand. However, what I really want to do is figure out why this is not working on this particular machine. As mentioned in my question and in other comments, I have grown quite accustomed to writing quick and dirty Javascript tests on my desktop. I've been doing it since 2000, at least. It's a hard habit to break and it ticks me off when I have to change the way I work just because one particular machine decides to give me a hard time. It's ridiculous and far from ideal. There must be a solution. Jan 5, 2010 at 19:57
  • the problem might very well be related to the McAfee security suite (which you can't configure?). so, again, a virtual machine without McAfee is one quick way to find out. i mean, there is no real trouble-shooting possible if you can't eliminate the main suspect, is there?
    – Molly7244
    Jan 5, 2010 at 20:16
  • @Molly, as I commented on the question, we've already tried disabling McAffee completely. Plus, my colleaques are under the same McAffee "policy" and everything works as expected on their machine. I'll update the question to include whay I've tried. Thanks! Jan 5, 2010 at 20:46
  • "trying to disable" is a quite strechable expression. are there any identical machines in your company? then have one cloned onto your machine if that is feasible. speaking of cloning, create a full drive image, and then start ripping it apart if you're really interested in the cause. not very cost efficient and i would only do it to satisfy my professional curiousity.
    – Molly7244
    Jan 5, 2010 at 21:17
  • Let me rephrase that... using administrative privelages, we completely disabled all McAffee services on my machine and it did not fix the issue. Two colleagues have identical machines as me, and they do not have the problem. Identical is stretching it, because obviously I have my own personal settings stored in my user profile. I have tried signing on to one of those identical machines, and when I do that, everything works fine. Issue is completely localized to this machine, and I can't ghost over it because then I will lose all my local settings for apps like Visual Studio, etc. Thanks :) Jan 5, 2010 at 21:27
1

I know other persons who had this issue, so I investigated into it.

After lot of efford to replicate the error, I found the culprit.

read this: http://social.answers.microsoft.com/Forums/en-US/InternetExplorer/thread/2a0b55bf-6807-4f72-b10c-53f958af9b42 and http://social.technet.microsoft.com/Forums/en-US/w7itprosecurity/thread/90c3202c-448b-42b7-acf7-dab8dba7b000

Seems that something (a virus, or some software update) mess with the internet zones.

To fix the problem I exported all the registry and with a editor(ultraedit) searched for "\Internet Settings\Zones\" founding a key like "{Exadecimal-USER-IDENTITY}...\Internet Settings\Zones\L" where L is a strange character that displays like a superscript L, As you delete that key javascript will restart working.

0

Here are two thoughts that may help:

Rename it to test.hta - this will launch it as an HTML Application instead of just plain HTML. You may need to add <HTA:APPLICATION> with a few attributes to inside the HEAD element - but it should work like a champ. You can read more about HTA's here: http://msdn.microsoft.com/en-us/library/ms536496.aspx

Can you use a local web server to perhaps get around the file system issues? If you were to install Visual Web Developer Express it comes with a web server you can use for testing, or you could always install IIS (if it is WinXP Pro), Apache, etc.

3
  • Changing to .hta works, but it does not open in Internet Explorer. I am aware of the work-around options, but I ultimately need to get JS to run on my C: drive within an HTML file. Jan 6, 2010 at 17:50
  • An HTA uses the same rendering engine and the same Windows Scripting Host to supply the javascript support as Internet Explorer. Why is it a requirement to open in Internet Explorer? I would argue that while technically it is not launching iexplore.exe - it effectively is running identically to how it would in the browser with more lax security restrictions. If you needed it to potentionally run in other browsers or other operating systems, that would drive the requirement... but I don't see that from your question or comments.
    – Goyuix
    Jan 7, 2010 at 3:10
  • Bottom line: this is a work-around. I am not a fan of work-arounds. I will not sleep until I understand the underlying issue. I think that's natural behavior for a programmer. DOn't take it personally, there is a problem here that I want to solve, not work around. Jan 8, 2010 at 17:07
0

Trying editing the settings for DCOM

Go to Run and type dcomcnfg, under component services right click on my computer and go properties. Then go to Default properties and Enable COM internet Services on this computer. also check and make sure Default Authentication Level is set to connect and Impersonation level is set to Identify.

5
  • Darn, I thought this would work, but no dice. The problem still exists. Thanks for the answer, though! Jan 6, 2010 at 17:48
  • did you reboot after?
    – jburke
    Jan 6, 2010 at 17:48
  • No I did not, but I will try that too. Jan 6, 2010 at 19:45
  • ok, usually the dcom settings won't go into effect untill you reboot. good luck!
    – jburke
    Jan 6, 2010 at 20:26
  • Tried rebooting, still no luck. Darn :( Jan 6, 2010 at 21:45
0

If you go to Internet Options / Security Tab / Internet / Custom button, then scroll down to the Miscellaneous section, you will find several entries that control the JavaScript engine in IE8.

You might compare them on your computer with these on a computer on which this works.

If with this you don't find the problem, you can also do the same with
gpedit.msc / Local computer policy / Computer Configuration / Administrative Templates / Windows Components / Internet Explorer.
You can here right-click on "Internet Explorer" and Export all the settings to a text file, which will help in comparing them between the two computers.

0
0

I suspect this won't help, but have you checked the registry key for allowing local scripts to run?

HKCU \ Software \ Microsoft \ Internet Explorer \ Main \ FeatureControl \ FEATURE_LOCALMACHINE_LOCKDOWN

In the right-pane, create a new REG_DWORD named iexplore.exe and set it to 0

Values:

0 - Allows a Web page to run active content in your computer
1 - Disallows a Web page from running active content in your computer

This document contains some other related registry keys you may want to look at:

http://msdn.microsoft.com/en-us/library/ms537183(VS.85).aspx#registry

2
  • Thanks, but the DWORD was already there, and set to 0 :( Jan 8, 2010 at 19:34
  • I am going to look through those other registry entries though; thanks for the link! Jan 8, 2010 at 19:35
0

I'm not sure you can add a local drive into the Trusted sites zone.

You have to check the restrictions into the zone and best set it to custom level and enable all options that concern Scripting and ActiveX, because even at the lowest level (of preset settings) there are still restrictions that apply.

I had a similar problem with IE6 and I could fix it by removing all of the restrictions of the default zone (Internet). If you somehow managed to add the file to trusted sites, you have to set the zone to "custom level" too.

I think it is this setting that you have to enable for sure:

Initialize and script ActiveX controls not marked as safe for scripting. - It affects both "marked as unsafe" and "not marked"

1
  • It does not appear to allow me to add the C: to the trusted sites zone. It gives me some stupid invalid wildcard sequence message. I've compared all the ActiveX settings with my colleagues, and they are identical. Jan 8, 2010 at 21:33
0

You could try to verify the IE8 installation by using the Microsoft tool found in:
How to solve Internet Explorer 8 installation problems.

This article contains a Fix It button that does general troubleshooting for IE8.

I quote:

Problems with installing Internet Explorer 8 can be caused by different issues. That's why there are several troubleshooting methods that you can use to try to resolve your problem.

To fix this problem automatically, click the Fix this problem link. Then click Run in the File Download dialog box, and follow the steps in this wizard.

Even if this immediately fixes your problem, you should still reboot and check again. If the problem has returned, then this is probably a GPO problem.

In addition, I found an interesting thread that may apply:
After IE8 update- Open File Security Warning for all local execute.

I quote:

After taking a lot of time with the registry, the internet, and some alcohol (just kidding), I think I found the source of the problem. :) I am pretty sure that it is the source of it, since I can reproduce my problem by toggling the value of a certain registry key back and forth. Curious? :) OK, here we go:

The following registry key has been identified to cause the problem: [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Lockdown_Zones\0]

According to KB182569 (http://support.microsoft.com/kb/182569) this key is responsible for: "Miscellaneous: Launching applications and unsafe files."

The same article also specifies: "Note Unless stated otherwise, each DWORD value is equal to zero, one, or three. Typically, a setting of zero sets a specific action as permitted, a setting of one causes a prompt to appear, and a setting of three prohibits the specific action."

I found that if I set "1806" dword value to "0" and then use the task manager to kill the "explorer" task and start it again, the problem had disappeared. If I changed the value back to "1" and killed/started the explorer again, then the problem was back.

Now I started to search my system for applied GPO's and found one that was setting this value to "1" which means prompt the user. It is set within a GPO under the [User Configuration/Administrative Templates/Windows Components/Internet Explorer/Internet Control Panel/Security Page/Lock-Down Local Machine Zone/Lauching programs and unsafe files] section.

Like I said, this is the source of my problem and I now know how to fix it. But what is strange to me is that the same GPO applies to IE7 machines and the problem does not surface there. According to description of the GPO, this feature was supported since IE7:

Launching programs and unsafe filesSetting Path:

User Configuration/Administrative Templates/Windows Components/Internet Explorer/Internet Control Panel/Security Page/Locked-Down Local Machine ZoneSupported On: At least Internet Explorer 7.0ExplanationThis policy setting controls whether or not the "Open File - Security Warning" prompt is shown when launching executables or other unsafe files.

For instance, if the user launches an executable from an Intranet file share using Windows Explorer, this setting controls whether or not a prompt is shown before the file is opened.

If you enable this policy setting and the dropdown box is set to Enable, files will open without a security prompt. If the dropdown box is set to Prompt, a security prompt will be shown before opening the files.

If you disable this policy setting, files will not be opened.

If you do not configure this policy setting, users can configure the prompt behavior. By default, execution is blocked in the Restricted Zone, enabled in the Intranet and Local Computer zone, and set to prompt in the Internet and Trusted zones.

So based on the description of the feature and what I have been experiencing, I have come to the conclusion that IE7 was handling this feature incorrectly and IE8 does finally handle it correctly. This would explain why the update to IE8 caused the feature to appear.

0

The only way around this is to go to Internet Ooptions and place localhost inside the trusted zones, however I really do not recommend this as it can lead to a lot of problems.

I would recommend you install either Apache, Wamp Server (containing Apache in an easy to use package) or IIS / Web Platform Installer (containing IIS in an easy to use package).

Then depending on how you set it up, you should be able to access the site through http://computer_name - or set up additional DNS entries for intranet or similar. If you have multiple computers that need to access this script, it will also make updating and everything else a lot simpler.

Edit -

Take a look for this setting in Internet Options -

alt text

4
  • Adding localhost to Trusted Sites does not work. I realize that I can setup a server, and I do use one for my primary development. But sometimes I will just write a quick and dirty test (on occasion, for answering a question on this web site!) and save it on the desktop, where I can easily execute and delete it. I've grown accustomed to doing this, and it works fine on all my other computers except this one. Something is the matter, and there must be a way to correct it. Jan 5, 2010 at 19:52
  • Could it be version of Windows / Internet explorer? It is since (I think) SP2 of XP that javascript was blocked locally. Jan 5, 2010 at 20:16
  • ... updated - Have you checked for - i50.tinypic.com/29vcx15.jpg Jan 5, 2010 at 20:18
  • @Wil Yes, and I mentioned that in the question. I've included a couple more things I have tried in the question as well. Jan 5, 2010 at 20:48
-1
  1. Start Internet Explorer.
  2. On the Tools menu, click Internet Options.
  3. On the Advanced tab, click Reset.
  4. In the Reset Internet Explorer Settings dialog box, click Reset to confirm.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .