open vbs file without prompting File Download message

G

Guest

GOOD morning,

I try to open xx.vbs in <href="./xx.vbs"></hef> but it pop up the file
download mesage. How can i disabled it?

I try another solution like this :
set ws = createobject("Wscript.shell")
set oexec = ws.exec("<%=server.mapPath(./xx.vbs)%>")
But it give error "the path/xx.vbs is not a valid win32 application"
May i know why? I think some setting in registry will open the vbs file
without error or prompting. Kindly advice.
 
C

cbDevelopment

You are asking a user to automatically execute a VBS file when they click
a link on a web page? I would assume this is a safe, controlled
environment, but the security risks to enable such a feature would not
make it realistic.

The client would need a MIME type configured for the VBS extension that
would automatically launch the file using WSCRIPT (or CSCRIPT).

Your second solution is telling the client to execute a file in the
location the file is stored on the server. e.g. The server has the VBS
file in d:\Web\scripts\xx.vbs. The client hits the page and is told to
run "d:\webs\scripts\xx.vbs" The client doesn't even have a D Drive.
The path is meaningless to the client.

--
 
G

Guest

Firstly thank you for the reply.
May i know how can i set the MIME type configured in VBS?

i had copy the file into client local path which is in c:\temp\xxx.vbs. but
it still give me this error "is not a valid win32 application"?why?

Thank you
 
C

cbDevelopment

The MIME types (or Content Types) for Windows are in a series of registry
entries in HKEY_CLASSES_ROOT. Some browsers like Netscape and Opera allow
additional MIME types to be configured for their use.

Try executing the script using the script host, as in: "wscript.exe c:\temp
\xxx.vbs" or "cscript c:\temp\xxx.vbs" No guarantees that it will work.
At best you will get a security warning asking if you want to Open or Save
the file.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top