Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 24th, 2007, 07:27 AM
Registered User
 
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Execute VB Script from ASP

Hello everyone,

I am trying to execute a vbs file which would read a text file and insert into the database.

I have an asp page with form controls and when i submit, in the process page have to execute the vbs file. have been trying to use
WShShell = Server.CreateObject("WScript.Shell") and run the file but not happening.

Can anyone help me out with this??

CODE:

dim WShShell, RetCode
Set WShShell = Server.CreateObject("WScript.Shell")
RetCode = WShShell.Run("D:\Project\website\admin\MigratePric eList.vbs",1, True)
response.write RetCode
set WShShell = nothing

Thank you
Krishna Kumar
 
Old January 31st, 2007, 08:38 AM
Authorized User
 
Join Date: Dec 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

It probably isn't working because the Internet User account doesn't have the right permissions and giving it the right permissions would represent a security risk.

I'd write a flag to a database table and then set the Windows Scheduler to run the vbs every 5 minutes or so - in the vbs you initially poll the database table and if the flag is set you carry on running the rest of your script, if not you exit until next invoked by the Scheduler.

http://www.thewebsiteshop.co.uk






Similar Threads
Thread Thread Starter Forum Replies Last Post
can't execute code from a freed script violetcrystal Javascript 4 April 21st, 2006 05:04 AM
Automated Execute Script itHighway Classic ASP Professional 3 November 21st, 2005 03:03 PM
Automated Execute Script itHighway Classic ASP Basics 0 November 17th, 2005 12:36 PM
asp vb script error rsjaladi Classic ASP Databases 2 November 26th, 2004 10:46 AM
Deleting Tables in SQL using ASP and VB Script sideshow245 Classic ASP Databases 1 February 2nd, 2004 07:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.