473,394 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

wscript.shell does not execute .vbs

Done a bunch of searching on this topic and i have come up with nothing.

I have a .vbs script that i wish to execute by calling an asp page.

i am working on a W2K server with IIS5.0 & SP4.

My stopwebsite.vbs file is as follows:

===
On Error Resume Next
fullPath = "IIS://Localhost/W3svc/57"
Set oServer = GetObject(fullPath)
If Err <0 Then
Display "Unable to open " & fullPath & "."
End If
oServer.Stop
If Err <0 Then
Display "Unable to stop web server " & fullPath & "."
End If

Sub Display(Msg)
' WScript.Echo Now & ". Error Code: " & Hex(Err) & " - " & Msg
End Sub

===

NOTE that display doesn't do anything

my stopwebsite.asp script is as follows:
===
<%
On Error Resume Next
Set objScriptShell = Server.CreateObject("Wscript.Shell")
strCommand = "cscript.exe //b d:\inetpub\websites\admin\stopwebsite.vbs"
intReturn = objScriptShell.Run( strCommand )
response.write( "Command returned: " & intReturn )
Set objScriptShell = Nothing

if err.number <0 then
response.write "<hr>Error detected: " & err.number & ": " &
err.Description & "<br/>"
response.end
End if
%>
===

Normally i get that the command has executed successfully (ie. i get a 0
returned).
however the script doesn't actually run.

NOTE: i can run the command ("cscript.exe //b
d:\inetpub\websites\admin\stopwebsite.vbs") from a command line when logged
in as administrator successfully
I can also simply double click on the vbs (which i assume is executed by
wscript) from file explorer and it works successfully.

Things i have tried & applied:
the asp script is running on it's own virtual website with anonymous access
disabled. As such i am logging in as administrator when prompted.
i have tried different user permissions on the asp script & the vbs script.
at this point, everyone has full access to both scripts. this did not seem
to help.

any ideas??

thanks in advance.
yt

PS -- when i was locking down my server, i removed the built-in iis
administration website and probably the files that go with it. is there a
way to restore that without removing & reinstalling iis?
Aug 1 '07 #1
0 4588

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bill | last post by:
I used to be able to run the following ASP code on our corp machine (W2K Server Edition and IIS-5) and successfully send a net-msg to anyone on our intranet. Last week it stopped working... and...
2
by: news.microsoft.com | last post by:
Good morning everybody, How can I use WScript.Shell to execute Ms-DOS commands and can I see the outputs commands in the asp page? In the past, using Win. NT 4 Server and cmd..shell attribute...
0
by: Kyle | last post by:
To any who chose to provide an answer, or even any suggestions to this problem, I thank you greatly in advance. +200 pts. for any valid solutions. I am currently in the process of converting a...
0
by: Aayush Dubey | last post by:
Hi, I cannot execute the batch file through my ASP page..The code is below Set WShShell = Server.CreateObject("WScript.Shell") s=WshShell.Run("c:\aayush\test.bat",1,False) the drive c: is...
6
by: MacKenzie | last post by:
The statement in an asp page: dim objShell Set objShell = WScript.CreateObject("WScript.Shell") now gives this error: VB err= 424,Object required If I use...
2
by: rcmail14872 | last post by:
I have seen some very general suggestions for alternative code to the WScript.Shell code, but nothing specific. In the two lines of code below (I think) the first line creates a text file on the...
0
by: edurran | last post by:
Hi all, I have spent the last three days on this problem. Looked in many forums and not found the answer as yet. Hopefully ye can help. I have two functions. One works fine, the second does...
2
by: =?Utf-8?B?VG9kZA==?= | last post by:
Hello I'm using the following script to try and ping: <% Response.Buffer = true %> <% url = "www.espn.com" Set objWShell = CreateObject("WScript.Shell") Set objCmd = objWShell.Exec("ping " &...
2
by: =?Utf-8?B?c3RldmV3YQ==?= | last post by:
Microsoft VBScript runtime error '800a0046' Permission denied ======================= Trying to find the solution is driving me crazy. Using IIS6 on Server2003 SBS Default website localhost...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.