'WScript' Hasn't Been Defined"

I use the following code in developing a web application with ASP. But after viewing in browser, it told me "Error: 'WScript' hasn't been defined".

the following code:
<script language="JScript" >
function funGetSleep()
{
//to sleep 1 min
WScript.Sleep(60000);
alert("it is ok");
}
</script> .

View Replies


ADVERTISEMENT

Using WScript In ASP

how to use WScript in ASP? I figured out that if I use a WSH object to send the keystroke {F5} it will refresh the pages adequately. (see my thread Refreshing Pages! for what I am taling about) Anyway, this code: Code:

Set wshshell=WScript.CreateObject("wscript.shell")
wshshell.sendkeys {F5}

Should accomplish this. Or something similar should work. Anyways, I don't entirely know how to do this.

View Replies View Related

Defined Query

Here's what I want to do.I've displayed records from the Db to a page called Inns.asp.
Among those records are COUNTY, CITY, STATE, ZIPCODE.
I created four asp pages called CountyInns, CityInns, StateInns, and ZipcodeInns.
They all display respective records with links to a redirect page. That's where I get stuck.If I have 50 records, say, displayed, i.e., COUNTY, how can I run a script against all the possible counties, without having to write a script for each and every city within that county?I do things somewhat differently, because this stuff is too tricky for me. It doesn't come easy but I usually get it right after a lot of help and attention. I bet there are other ways to do this but i'm not sure I can learn it any other way than the way I do it. Inns goes to CountyInns which leads to CountyInnsRedirect which (hopefully)contains a script for individual County display.

View Replies View Related

Collection Defined

I am processing a form and I want to double check that a field is defined so that no error occurs. How do I check if a key exists in a collection (the Request.Form collection)?I do not want to process all of the fields in the form, so I do not want to use "For Each x In Request.Form". I process a certain list of fields and just in case the field was left out, I want to prevent an error from occurring from trying to use a key that does not exist.

Code:

For Each x In arrayFields 'arrayFields contains certain field names
'verify that field actually defined
If [field is a key in the Request.Form collection] Then
stringTemp = Request.Form(x)
'do stuff
End If
Next

View Replies View Related

Variable Is Defined

I'm having trouble with checking if a variable is defined. It is the conidtional statement of an IF statement.Ex.

IF var is defined then

action
else
action
ENDIF

View Replies View Related

WScript Error

Im beginner in VBScript.Im getting an
errorregarding "Wscript" means whenever I use WScript object, it shows
Errors as " Object required: WScript" & "Variable undefind :
Wscript" . Mostly I get "Object required: Wscript" erroe message
whenver I declare
WScript object.

View Replies View Related

Using Wscript Object

how to copy a file from local machine to remote machine using wscript object.

View Replies View Related

Wscript.Shell

Currently, I move a application from win 2000 server to 2003 server, I use some vbs file in this application, however, it seems that those vbs file can not be run from 2003 server. Below is my code, can some one point out what did I do wrong here?

DIm objShell
Set objShell = Server.CreateObject("WScript.Shell")
objShell.Run(ExeName)
Set objShell = Nothing

View Replies View Related

Wscript Permissions

i created an asp script that calls wscript which in turn calls up an .bat file. I have tested this script on my machine on my home win2k3 machine but cannot reproduce the same thing on my other server. Right now, IIS requres "intergrated windows authentication" login and run the script.

I ve given the user account every possible permission combo i thought of. The script in question has permissiont to run, it even has admin priviledges for testing purposes. But nothing happens when i run it from my page. I am completly stuck right now. No idea how to persue this b/c ive exhuasted every possible thing i know and every tip i read about.

View Replies View Related

Auto Login For Pre-defined Ip's

The site is for subscribers only. The frontpage is open to everyone, but when one clicks a link on the frontpage, the visitor is redirected to a login form. The code that processes the form checks the username and password. If they match, a session variable is set and the browser is forwarded to the link clicked in the first place.

Now, I want to make a addition: When a user that is not logged in clicks on a link on the frontpage, before the login form is shown, I want to compare the browser ip address to a list with subscriber ip addresses. If the browser ip is in that list, the login form should not be shown. Instead should the session variable be set and the browser forwarded to the article requested. Code:

View Replies View Related

User Defined Function

I have to Execute a User Defined function from ASP page and also the function returns a varchar. Could someone help me out with the code for this.

View Replies View Related

User Defined Personalization

I need someone to point me in the right direction. I would search, but I am not certain what I neen to search for. Here is what I want to do.

My Intranet homepage has four content-blocks of information. Each content-block has specific type of information (i.e. HR stuff or international stuff).

I'd like to add more of these content-blocks an give our employees the option of choosing which four they want to see.

Most portal technology offers this, such as My Yahoo. What kind of technology do I need to look into? Cookies? Are there any scripts that I can use to assist with this?

View Replies View Related

User-defined Class

This is my user-defined class
class ABC
public CC
end class

I make a instance of it and store it at the session
set ee=new ABC
ee.CC="hi"
set Session("myobject")=ee

But when i retrieve it and access the property of my
object, it said that The object does not support this
property or method, is that ASP cannot do this, or my
code has error?
set eee=Session("myobject")
response.write eee.cc

View Replies View Related

User Defined Personalization

I am looking to personalize my Intranet homepage were the user has the information they want on their page.

For example all their fav sites on the homepage, like the news headlines, email account already open for them, any suggestions of how to start or the best possible recources to use.

View Replies View Related

Defined Folder And Files

I am using aspload to allow users to upload three files - 2 pics and a word
doc. The files have standard names but I want the user to define the name of
the folder.

Is there and efficient way to make sure that the user does not choose
illegal characters for folder names? I am doing a series of replaces at the
moment.

View Replies View Related

User Defined Tables

I am trying to get the list of all user defined tables from the Access database. If I use the following query in Access it's working fine and getting the result. But if I am trying to execute the query in ASP page, it's not working. I am getting an error ([Microsoft][ODBC Microsoft Access Driver] Record(s) cannot be read; no read permission on 'MSysObjects'.)

Can u please tell me the reason.


SELECT MSysObjects.Name AS TableName
FROM MSysObjects
WHERE (((MSysObjects.Type)=1)
AND ((MSysObjects.Flags)=0));

If you have anything, to extract user defined tables, please tell me. Either one works out for me.

View Replies View Related

Type Not Defined Error

I'm getting the following compilation error on the line of vb.net code below. Compiler Error Message: BC30002: Type 'DirectoryEntry' is not defined. Dim dirEntry As new DirectoryEntry(strLDAPPath)

I have System.DirectoryServices added to the project references and to the aspx form. The autogenerated code includes "Imports System.DirectoryServices" in the source. Any idea what's need to get the compiler to see the reference?

View Replies View Related

JS Function Defined By ASP Not Executed

I have a pop-up window with a search button. If click on this button then a record list is made on this pop-up window. Each record have field with a href link. If you click on the href link next function is executed: Code:

View Replies View Related

User-defined Objects

How does one create user-defined objects in ASP? Sorta like the response and request objects, where you can do response.write, etc.

I'd like to create my own object called Customer, so I could do Customer.firstName, Customer.lastName, customer.age, etc. I couldn't find any helpful info on this topic on the Internet or in my ASP books.

View Replies View Related

User Defined Functions

I'm forced to use legacy ASP for a new project i am working on and seeing as how I never use ASP I needed a little help with something.

I need to create a function with optional parameters. I know in .Net I can use the "optional" keyword in the function definition to create optional parameters. can this be done in ASP 3?

View Replies View Related

WScript.Shell Run Error

I am currently in the process of converting a website from an existing
web host to our servers. This website used the WScript.Shell command
to execute a series of Java commands that would send an encrypted
email.

I ran these commands directly on the server and they execute properly,
but when I try to run them from within the WScript.Shell command then
I get a return code of 1, and the actions that should be completed are
not.

The shell is executing a .bat file which is in the same directory the
text files it needs to run the following sample command(s): Code:

View Replies View Related

Wscript.Shell.run Returns 254

I am trying to run a command line from an ASP page. I am using windows 2003 with IIS6. I am able to get this to run on my local machine (Windows XP IIS5). Here is my code:

View Replies View Related

Wscript.shell Win2k

For win2k adv server/iis5.0 trying to run an external program from my asp routine that has multiple
parameters, see following.

set shell = server.createobject("wscript.shell")
shell.Run """f:phsDatahtmldochtmldoc.exe"" --webpage -f phsnew.pdf
phsnew.htm"

program either doesn't get invoked, or has an error, but since it has no error log i can't check that, so not sure why not getting a result i have run the program successfully from the command line in that directory, so know it can be run in the first place and the asp program creates and writes files in the same directory so i don't think its a permission problem. asp doesn't complain with any errors.

View Replies View Related

Wscript.Shell Run Program

I am trying to use the Run method of WScript.Shell to run a program that creates image files on the server. When I run the program through the command line it creates a text file and a bmp file which is what it is supposed to do.

If I run it from an asp page it doesnt do anything, it also doesnt give me any error messages. I can run the same vbscript code in a standalone vbs file on the server and it works right. Code:

View Replies View Related

Running .vbs File From Asp Using Wscript

i'm trying to run a .vbs file from my asp web page using wscript but keep getting a 'permission denied' error on line 5

here is the code:

<%

Dim oShell
Set oShell = Server.CreateObject ("WSCript.shell")
oShell.run "C:inetpubwwwrootib_submit.vbs" '(line 5)
Set oShell = Nothing

%>

View Replies View Related

ActiveXObject Vs WScript.CreateObject

what is the difference between these two jscript statements?

object = new ActiveXObject("myobject.object");

vs

object = WScript.CreateObject("myobject.object");


on my samples they practically does the same. what are the differences (if any). when would you use one over the other?

View Replies View Related

Using WScript.Shell And The Run Command

I've been testing the WScript.Shell object and the Run command now for a server query. The file I am running generates a file with the server querys which i later on parse in my page. But there is a problem. When running the Run command om my Windows XP machine it all seems fine. But when trying to run it on my webserver (not configured by myself) I get an error, or the command fails. It's nothing wrong with the acctuall command but ASP seems to not want to allow the Run command.

First I though it had to do with user privilegies but after giving the IUSR_X full access it didn't help. So, does anybody know a solution for this? Exactly what do I have to configure, for what user, to make this work on my webserver (win2k).

View Replies View Related

Wscript.shell Error

Trying to view asp page which has the following code in
Set obj = WScript.CreateObject('WScript.Shell')

It falls over on this line saying 'Activex cannot create component (wscript.shell)'. Doing the same in a .vbs file results in the same error. The platform is NT4 Server Service Pack 6a.

View Replies View Related

WScript.Shell Object

I've made an ASP page that calls a small executable and collects its text output into a variable ("strExeOut") below. Below is some code similar to the one I use for that purpose.

strExe = "C:whatevermyprogram.exe -h1 -d33"

Set objShell = CreateObject("WScript.Shell")
Set objScriptExec = objShell.Exec(strExe)
strExeOut = objScriptExec.StdOut.ReadAll

I developed this in my own computer and the whole thing works like a charm, but
unfortunately I assumed my hosting provider would let me run the (little and harmless) exe, and they won't.

Therefore I have to run only the "exe" portion of the code in another web server and send back the output to my website on the net. I'd like to get some feedback on what would be the best way to call an exe on another server, and to have the output sent back.

View Replies View Related

Sending An Email At Defined Times.

I have a project where I want an email to be sent at a certain time, say 10 PM every night if there are new hits to my site. The email will be only going to my email address. does any one know of a way to do this?

View Replies View Related

User-defined Classes In Global.asa

I've read that one shouldn't include ADO objects in the Global.asa for the sake of performance, but would user-defined classes cause the same kind of performance hit? Assuming that they wouldn't, is it possible to do it?

I can't seem to figure out how to include them, nor find any reference to it in msdn.

Is there a way to do this? Or should I create a slew of Session variables? Code:

View Replies View Related

Column Name System Defined Variable

if I have some system defined variable in my table column, say I am using a column called Default which is bit type. Its enclosed in square braces like this [Default]. Whenever I try to modify a record, it returns the following error :

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'Default'.
/performaindia/maint/logtype.asp, line 170

in line 170 its
rs.Update

Any hints where to make the changes.

View Replies View Related

Wscript.CreateObject Error On ASP Page

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 setobjShell=Server.CreateObject("WScript.Shell"), I get the error
VB err= 5,Invalid procedure call or argument

I believe it stopped working in July 2004 after a security update. I have
re-registered the appropriate dlls and ocxs.

Does anyone have an idea? I am trying to use this object so that I can
execute a batch file that was created earlier in the program.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved