Connecting Tech Pros Worldwide Forums | Help | Site Map

how to run vb script file via IIS 6.0 without prompting to open/save

AnuSumesh's Avatar
Member
 
Join Date: Aug 2007
Posts: 96
#1: Jan 2 '08
Hi,

I am redirecting from asp page to vbs file.The VBS script resides on same folder as of asp pages in my windows/IIS server.
I am using windows2003 and IIS 6.0.
Script is running properly but it is asking user to open/save the file.

My code for .asp page is :

<%@language="vbscript" %>

<% dim a

a=request.form("sometextbox")
if a="" then
%>
<html>
<body>

--------some code -------
</body>
</html>

<%
else
response.redirect("file.vbs")
end if
%>

code for file.vbs file is:-

On Error Resume Next

Dim ForReading

Dim Filename,fil,fold
Filename="C:\temp.txt"

ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")

set fil=objFSO.GetFile("c:\temp.txt")

If objFSO.FileExists(Filename) Then

Set objTextFile = objFSO.OpenTextFile _
(Filename, ForReading)

IP=objTextFile.ReadLine
objTextFile.close

'Delete the temporary file
fil.delete(true)

'Call RDP

dim wshell
set wshell=CreateObject("WScript.Shell")
wshell.Run "C:\windows\system32\mstsc.exe /v:"& IP
set wshell=nothing
End If


It is first asking me to open or save the file.
If i click "open" then it asks to run or don't Run
But i want to hide these internal workings from the users.
How do i prevent these popup from occurring?

Can anyone help me in this issue?

Thanks in advance.

Anu

kenobewan's Avatar
Moderator
 
Join Date: Dec 2006
Posts: 4,745
#2: Jan 3 '08

re: how to run vb script file via IIS 6.0 without prompting to open/save


I don't use asp, but what happens if you use wshell.Run "mstsc.exe"? You may be able to this using a windows form, but not sure in asp.
Reply