I am trying to run a JavaScript command from the command line, in Windows 7, using a batch file. The batch file is run as an administrator.
I am trying to open an Internet Explorer 8 window, as part of a longer routine. If I simply call IEXPLORE.EXE in a batch file without using JavaScript, Internet Explorer 8 opens okay:
"C:\Program Files\Internet Explorer\IEXPLORE.EXE"
If I call a URL as well, the specified page opens:
"C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://www.google.com
However if I try to use JavaScript in the batch file, to control the size and location of the Internet Explorer 8 window, an Internet Explorer window starts to open but before it finishes opening the routine aborts with the error message 'Unable to download. Unspecified error.':
"C:\Program Files\Internet Explorer\IEXPLORE.EXE" javascript:window.open("http://www.google.com","newwin","left=10,top=10,width=520,height=250");
Active scripting is enabled in Internet Explorer's options.
The fault does not appear to be caused by the DOCOBJ.DLL file which comes with older versions of Microsoft Office. Although I did install Office on my system, which is running Internet Explorer 8, so an old version of DOCOBJ.dll was registered, I have since unregistered it and re-registered IEPROXY.DLL but the fault with window.open() persists -
"C:\Program Files (x86)\Internet Explorer\ieproxy.dll"
Can anyone suggest what I'm overlooking?
