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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute ASP script from another program?? 4

Status
Not open for further replies.

dwest100

Technical User
Aug 9, 2003
59
US
Hi,
I have a monitoring utility which will execute scripts etc. based on whether a folder has a new file added to it. It constantly monitors the folder for changes and then executes the specified script.

I want to have it run an ASP page when the folder has a change.

I think all I need is a batch file to start IE, load and process the ASP page, then quit IE.

The monitoring utility will run the batch when the folder is changed.

How can I do that in a batch file or otherwise?

All solutions welcomed.

Thanks!
DW
 
all you need to do to pass iexplore.exe a parm is add it after the call

so.
Code:
iexplore.exe [URL unfurl="true"]http://youserver/yourscript.asp[/URL]

this isn't what ASP's are intended for though and there isn't anything a straight vbscript or jscript (or any other scripting language) cannot do that an ASP page can.
 
Thanks!
Here is what I'm trying to hack together. I'm not a programmer-that's the problem :)

I have a form on my BLOG that allows a visitor to subscribe to receive each daily post in their e-mail as an HTML e-mail.

The form simply takes their e-mail address and appends it to a text file on the server. (I also provide a means for them to unsubscribe, which removes their e-mail from the text file.)

The form is ASP.

Here is the part I'm hacking together:
On the server, I want to monitor the content folder of the blog (which contains only XML files for each post and comments) and when a new XML file is added, Convert it to HTML and e-mail it to everyone on the list.

-I have an ASP script to convert the XML to HTML which works well.
-I have another ASP script which streams in the HTML as the e-mail message body and sends it to the e-mail addresses in the subscriber text file.
-I have the utility mentioned in the original post which monitors the content folder and will run the ASP script when an XML file is added.

I am certain there is a much easier way but I haven't a clue how to approach it.

Any recommendations?
Thanks!
DW
 
i method I've used it XMLHTTP, which can be used in a vbs file which can run asp pages..


Code:
' VBScript source code
Dim objXMLHTTP, xml
' Create an xmlhttp object:
Set xml = CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", "[URL unfurl="true"]http://www.yoururl.com/whatever.asp",[/URL] False
' Actually Sends the request and returns the data:
xml.Send
set xml = nothing

it works and you can put a schedule on it to run whenever you want.
 
Are the XML files uploaded as files or created through a form on the site? It might be easier to send the emails as a function of the original posting than to try monitoring the folder and executing a function separately.

As onpnt pointed out above, you could just as easily use a VBS file to do what you want. You use essentially the same code but do not have to worry about launching and closing an instance of IE to run it as ASP code and you will have greater access to the operating and file system as it would be running in a local security context rather than from the web server where it will be more restricted.


Stamp out, eliminate and abolish redundancy!
 
Thanks for all the input. It dawned on me last night that I might be able to hack into dasblog and e-mail the posts as part of the posting process.
I'll try that after I give the above vbscript a try.

Thanks to all!
 
One quick question for nicklieb:
How do I actually run the vbscript? I'm not hip on this obviously :)

Thanks!
DW
 
You can run the .vbs file the same way as a .bat file... ie: double-click, command line, scheduler, etc..
 
Thanks Sheco. I figured that out after reading up in WSH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top