Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 3rd, 2008, 10:45 AM
Authorized User
Join Date: Sep 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to misskaos99
Default .ASP and .VBS

How can I call a vbscript (.vbs) from an ASP page? (.asp)??
Old January 3rd, 2008, 11:05 AM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

Hmmm this could quickly turn into Pandora's Box for you. What I would suggest first is to examine the .VBS file and see if you can turn it into an ASP page instead. If you can then go that route.

If it can't then you will need to use something like:

set wshell = server.CreateObject("WScript.Shell")
strCommand = "cmd.exe /c c:\myCode.vbs
set wshell = nothing

Here are a few of the caveats:
By default the XXX_IUSR account does not have rights to execute this command (for good reason) so you will need to elevate that users permission (or whatever user you have configured that your website runs under)

If you are using IIS 6+ you need to assign a user for the subweb and give that user permissions to execute wscript and cmd.

I would definately not advise doing this since it opens your server up to malcious attacks.


================================================== =========
Read this if you want to know how to get a correct reply for your question:
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
Old January 3rd, 2008, 11:36 AM
Authorized User
Join Date: Sep 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to misskaos99

 OMG! D!! I was wondering if you would be around!! Ok.. lemme read your reply lol, just saw your name and had to respond. Thanks for the assistance, will see if it works.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing .vbs file from asp dsmike2008 Classic ASP Professional 0 July 17th, 2008 11:01 PM
Execute VBS files via ASP.NET (VB.NET) Mario_Steiner ASP.NET 1.0 and 1.1 Professional 0 November 9th, 2005 07:49 AM
VBS and FTP red4vbs VBScript 0 January 15th, 2005 12:59 PM
urgent--vbs samred Classic ASP Basics 1 January 5th, 2005 03:31 AM
Calling a .exe or .vbs file from ASP komalac Classic ASP Basics 1 September 16th, 2004 03:04 AM

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