Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Scripting HTML from server

Reply
 
Old 08-04-2009   #1 (permalink)
Eric


 
 

Scripting HTML from server

I wrote a VBscript program and put it in a .vbs file.
I put that file on the server and double click. It opens MS Word, no
problems.
I created a .html file in the same server folder and put code in for a
button with an onClick event to call a vbscript subprocedure.
In that subprocedure I put a window.open(fileName) to execute the .vbs file
I just created.
When I click the button I get a security warning asking if I want to run the
vbs, then another security warning when the vbs program tries to start Word.
How do I get rid of these??
I put the saved from url line at the top of the html file with a reference
to the domain of the server, which used to work. Now that we're running IE7
(on WinXP Pro) it doesn't work.



My System SpecsSystem Spec
Old 08-04-2009   #2 (permalink)
Al Dunbar


 
 

Re: Scripting HTML from server


"Eric" <someone@xxxxxx> wrote in message
news:#U5yfwTFKHA.1488@xxxxxx
Quote:

> I wrote a VBscript program and put it in a .vbs file.
> I put that file on the server and double click. It opens MS Word, no
> problems.
> I created a .html file in the same server folder and put code in for a
> button with an onClick event to call a vbscript subprocedure.
> In that subprocedure I put a window.open(fileName) to execute the .vbs
> file I just created.
> When I click the button I get a security warning asking if I want to run
> the vbs, then another security warning when the vbs program tries to start
> Word.
> How do I get rid of these??
One way would be to reduce your browser security settings. Unfortunately,
this would make you vulnerable to a number of attacks in the event you
browse to any pages you do not control.

Another way would be to convert your html into an HTML Application (HTA).

A third way would be to ask yourself why you are writing vbscript code to be
executed by a browser in order to run vbscript code to be executed by
wscript.exe in order to run word. Why not just have the vbscript in your
html file do whatever it is you need it to do?
Quote:

> I put the saved from url line at the top of the html file with a reference
> to the domain of the server, which used to work. Now that we're running
> IE7 (on WinXP Pro) it doesn't work.
Not sure about that one...

/Al


My System SpecsSystem Spec
Old 08-05-2009   #3 (permalink)
Eric


 
 

Re: Scripting HTML from server


"Al Dunbar" <alandrub@xxxxxx> wrote in message
news:%23ImMNEWFKHA.3556@xxxxxx
Quote:

>
> "Eric" <someone@xxxxxx> wrote in message
> news:#U5yfwTFKHA.1488@xxxxxx
Quote:

>> I wrote a VBscript program and put it in a .vbs file.
>> I put that file on the server and double click. It opens MS Word, no
>> problems.
>> I created a .html file in the same server folder and put code in for a
>> button with an onClick event to call a vbscript subprocedure.
>> In that subprocedure I put a window.open(fileName) to execute the .vbs
>> file I just created.
>> When I click the button I get a security warning asking if I want to run
>> the vbs, then another security warning when the vbs program tries to
>> start Word.
>> How do I get rid of these??
>
> One way would be to reduce your browser security settings. Unfortunately,
> this would make you vulnerable to a number of attacks in the event you
> browse to any pages you do not control.
>
> Another way would be to convert your html into an HTML Application (HTA).
>
> A third way would be to ask yourself why you are writing vbscript code to
> be executed by a browser in order to run vbscript code to be executed by
> wscript.exe in order to run word. Why not just have the vbscript in your
> html file do whatever it is you need it to do?
>
Quote:

>> I put the saved from url line at the top of the html file with a
>> reference to the domain of the server, which used to work. Now that
>> we're running IE7 (on WinXP Pro) it doesn't work.
>
> Not sure about that one...
>
> /Al
>
My workaround for now is to use an HTA file, but it looks different than an
HTML/HTM file.
I don't need to call the VBS program from the HTML file if the HTML is able
to do what the VBS program is doing. I just wrote the code to do what I
want to do in VBS and got errors trying to copy that code into the HTML
file. I might have been missing something so I could try doing that again,
but any way I've tried it I can't get the system to trust the HTML file.
The comment line at the top saying "saved from url" and referencing the
domain it's on was supposed to work but it still gives security warnings if
I try to execute the VBS program which is in the same folder or if I try to
open or execute a file on my C drive. The purpose of the HTML file is local
intranet documentation. I was trying to get it to execute the assigned
Windows Open method for a local file, so I tested the execute method using
MS Word to test, when I couldn't get the VBS open methods to work in the
HTML. I want to be able to run this from several computers on the domain so
I don't want to have to mess with browser security settings. I just think
it's odd that I can accomplish this from HTA or VBS but not in HTML. The
"saved from url" line just removes security warnings on executing simple VBS
code within the HTML, like displaying the last modified time of the page on
the page.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Scripting.FileSystemObject with VBScript in HTML page VB Script
Re: HTML and ASP scripting. VB Script
working on html objects using HTML DOM, VBscript VB Script
VB scripting help VB Script
Client - Server Scripting Problem VB Script


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46