Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unsafe ActiveX Controls

Status
Not open for further replies.

xsw1971

Programmer
Jun 21, 2001
153
US
I just used the script from today's "Getting rid of header/footer" post and it works, however before it will execute, I get a message box that says "Some software (ActiveX Controls) on this page might be unsafe. It is recommended that you not run it. Do you want to allow it to run?" When I click yes, the code executes just fine. How can I eliminate that message box (I have IE 5.0)?

Below is the script I used:

<script type=&quot;text/vbscript&quot;>
Dim WSHShell
Set WSHShell = CreateObject(&quot;WScript.Shell&quot;)
WSHShell.RegWrite &quot;HKCU\Software\Microsoft\Internet Explorer\PageSetup\header&quot;, &quot;&quot;
WSHShell.RegWrite &quot;HKCU\Software\Microsoft\Internet Explorer\PageSetup\footer&quot;, &quot;&quot;
</script>

Thank you!
JennieM
 
you can't !!! and that's good you can't !!!!!!!
you're writing datas in the user's registry - would you like anyone to be able to play with your registry without asking first ???!!!!
 
I realize that by saying 'Yes' to the message box above, it erases the header/footer information in the user's registry - permanantly. Is there a script I can write that will return the registry to its original state after the print job has executed?
 
Can the warning be turned off just for a particular page, or can I digitally sign the script and then trust scripts from that source, and suppress the warning that way?
 
Signing won't help, the warning is about using WScript.Shell, which doesn't need to be signed - and IS unsafe for scripting.

Unsafe means the object can alter the registry, write to disk, etc.

For what you're doing you need to use printer templates and the TemplatePrinter behavior (late versions of IE only). This is a complex topic. Try searching MSDN Library for the TEMPLATEPRINTER element.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top