Computing.Net > Forums > Programming > Calling Server Side VBS from ASP

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Calling Server Side VBS from ASP

Reply to Message Icon

Name: Mark
Date: August 27, 2003 at 03:27:16 Pacific
OS: Win2000 Server
CPU/Ram: P3Xeon 933/2Gb
Comment:

I'm trying to call a vbscript that runs two command line programs on the server that convert an ESRI .shp file to a transparent .gif

The vbs itself works, it runs fine from the server itself. However, I'm trying to call that script from and .asp page (I want it to run on the server). Everything that I can find in reference books or on the internet indicate I have the setup correct, but the script just doesn't run.

Does anyone have any experience of this?

My code is as follows:
On the .asp page:
Dim oWSH
Set oWSH = Server.CreateObject("WScript.Shell")
oWSH.Run "c:\arcims\website\routeP~1\routin~1\create~1.vbs"
Set oWSH = Nothing

In the vbs:
Dim MyTest
Set MyTest = CreateObject("Wscript.Shell")
'Run AutoImager to Create .gif from .shp
MyTest.Run "C:\Progra~1\Mystik~1\AutoIm~1\AutoIm~1.exe /f f:\ArcIMS\Website\ROUTEP~1\ROUTEI~1\route_3a.shp /c GIF /oc 8 /u /oq 90"
'Wait for 4 second while AutoImage completes
Wscript.sleep(4000)
'Run Giffy to convert to a transparent .gif
MyTest.run "f:\arcims\website\routeP~1\routeI~1\giffy.exe /ty \\gisdev\gisdev\arcims\website\routeP~1\routeI~1\route_3a.gif \\gisdev\gisdev\arcims\website\routeP~1\routeI~1\route_3a.gif"
Set MyTest = Nothing



Sponsored Link
Ads by Google

Response Number 1
Name: Chi Happens
Date: August 27, 2003 at 18:22:41 Pacific
Reply:

Most web servers do not allow you to make all types of objects from ASP, because it is a security risk. It is possible that the server you are trying to create the WScript.Shell object on does not allow you to create such an object.

If this is your server (meaning you administer it yourself and have physical or VPN access to) then you can set the permissions for the WScript ActiveX DLL to allow it to be created by a script.

If this is NOT your server (meaning it is a Host's server that you pay to have your web site on) then you will have to ask them if they would allow the WScript object to be created from your asp page.

Hope This Helps,
Chi Happens


0

Response Number 2
Name: Mark
Date: August 28, 2003 at 00:29:18 Pacific
Reply:

Chi,

I'm fairly new to web development, how do I set the activeX permissions for WScript?

Cheers,
Mark


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


BAT Files popular languages of toda...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Calling Server Side VBS from ASP

ASP Server-Side Real-Time www.computing.net/answers/programming/asp-serverside-realtime/4413.html

what's the best server side language? www.computing.net/answers/programming/whats-the-best-server-side-language/2808.html

Server side scripting www.computing.net/answers/programming/server-side-scripting/7434.html