Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


[RESOLVED]Cannot find Error in Script

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,55013
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> [RESOLVED]Cannot find Error in Script
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
 [RESOLVED]Cannot find Error in Script - 1/7/2008 12:26:39 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
This is actually a classic ASP page, but I thought you guys could help with this script..

I get an error of "Cannot Use Parenthese when calling a Sub" Error on Line 51, which is this:

response.Write "<br>Computer Found: " & rs(0)

This is what the script does...

There is a previous page with a drop down menu that is called "azou"

This script takes the value selected from the menu and checks the computer name that is stored in our login tracking database to see which computer that user is logged into.
Once it finds the computer, it is suppose to launch remote.exe on the client side with that computer name. 

Here is the script


      

< Message edited by twilliamsen -- 1/11/2008 12:27:13 AM >
 
 
Post #: 1
 
 RE: Cannot find Error in Script - 1/7/2008 12:29:17 AM   
  ebgreen


Posts: 4972
Score: 31
Joined: 7/12/2005
Status: offline
Which line is 51? Where ever it is, you will find that you are calling a Sub with () and you cannot do that in VBScript.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to twilliamsen)
 
 
Post #: 2
 
 RE: Cannot find Error in Script - 1/7/2008 12:33:02 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
Line 51 is this:

response.Write "<br>Computer Found: " & rs(0)


If I change

oWshShell.run( path,0,false)

to

oWshShell.run path,0,false

The error goes away, but does not launch the EXE file.

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Cannot find Error in Script - 1/7/2008 12:36:39 AM   
  ebgreen


Posts: 4972
Score: 31
Joined: 7/12/2005
Status: offline
Remove the On Error Resume Next and see what error you get.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to twilliamsen)
 
 
Post #: 4
 
 RE: Cannot find Error in Script - 1/7/2008 12:41:32 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
Error...

Object required 'request'

Weird...

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: Cannot find Error in Script - 1/7/2008 12:46:42 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi twilliamsen,

not to harass you, but to help other readers/lurkers of this forum to
avoid the very common pitfall of calling Subs with () - would you consider
doing something about

   http://www.visualbasicscript.com/fb.aspx?m=55012

After you solved your current problem, of course.

Regards

ehvbs

(in reply to ebgreen)
 
 
Post #: 6
 
 RE: Cannot find Error in Script - 1/7/2008 12:50:01 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi twilliamsen,

the error message suggest to me, that your code is executed
clientside (no server side response object available). Where
should this code be executed?

(in reply to twilliamsen)
 
 
Post #: 7
 
 RE: Cannot find Error in Script - 1/7/2008 12:53:19 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
I was not the post orignator.

Secondly, Yes, the EXE is called client side. 

This could be either a permissions issue, or a Windows 2003 Server security issue. 

Would this be better to wrap it into something else?  A HTA or something?

(in reply to ehvbs)
 
 
Post #: 8
 
 RE: Cannot find Error in Script - 1/7/2008 1:03:50 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi twilliamsen,

(a) for a quick test you could replace "response.write" with "document.write" (risk:
    destruction of page layout) or MsgBox (risk: many clicks).

(b) a (local) .HTA would avoid some permission/security trouble; in my opinion well
     worth a try

(c) "I was not the post orignator" - does that mean you don't feel responsible
     for the () in the .Run?

(in reply to twilliamsen)
 
 
Post #: 9
 
 RE: Cannot find Error in Script - 1/7/2008 2:14:19 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
ehvbs..

a. nope, still errors, select box does not build

b. tried it... still errors

c. I have no idea where this all came from.  I clarified an answer for the OP

(in reply to ehvbs)
 
 
Post #: 10
 
 RE: Cannot find Error in Script - 1/7/2008 3:43:35 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi twilliamsen,

this .hta


      

demonstrates (very simple versions of) the things you want to do.

(a) Database query

(b) building a SELECT from a resultset

(c) starting an .exe

Because I don't have your tables in my MSDE DB, I had to use a .txt file as poor
man's database. For that you need a schema.ini

[tblLogonLog.txt]
Format=Delimited(|)
ColNameHeader=True
Col1=sComputerName TEXT
Col2=sUserName TEXT
Col3=dtDateTime DATE

and a fake table (=txt file)

sComputerName|sUserName|dtDateTime
Comp1|User1|1/1/2008 01:01:01
Comp2|User2|2/2/2008 02.02.02

in the directory of the .hta. Changing the connection string and the SQL field names
(possibe problems with names like DateTime (reserved word) had to be avoided)
should make the .hta suitable for your environment.

Good luck!

ehvbs






   -------------------

(in reply to twilliamsen)
 
 
Post #: 11
 
 RE: Cannot find Error in Script - 1/8/2008 12:48:12 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
ehvbs....

Interesting...

I will need to change quite a bit of the code since it is taking a value from a previous page.  I will need to combine them.

But I see the concept.  :)

I will play with it later! 

Thanks! 


(in reply to ehvbs)
 
 
Post #: 12
 
 RE: Cannot find Error in Script - 1/11/2008 12:35:16 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
ehvbs...

I would like to thank you for pointing me to right direction.  So far the HTA is working beautifully. 

It is in its initial testing.  I wish I can figure out a way to run the Remote Control button from Remote.exe instead of them manually doing so.

I tried SendKeys, but that just kept launching new instances of remote.exe untill I killed the HTA.

Here is the final code:


      

(in reply to twilliamsen)
 
 
Post #: 13
 
 RE: Cannot find Error in Script - 1/11/2008 12:47:06 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi twilliamsen,

as I don't know/use Remote.exe, I have no clue about how to help you. Can you
explain the problem a bit further? Does the Remote.exe application start? How
did you specify the target for your SendKeys? Perhaps someone more familiar
with SendKeys can spot the problem.

Good luck!

ehvbs

(in reply to twilliamsen)
 
 
Post #: 14
 
 RE: Cannot find Error in Script - 1/11/2008 1:26:39 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
remote.exe is the application for Remote Tools for SMS.  It has buttons/menus in it for different tools.

The tool that needs to be used is Remote Control.

I did try the following code, and this sent it into a loop of re-opening remote.exe till you killed the app

wscript.Sleep 12000
oWSH.SendKeys "{F10}"
wscript.sleep 5000
 owsh.sendkeys "{ALT}"
 wscript.sleep 1000
 oWSH.SendKeys "T"
 wscript.sleep 1000
oWSH.SendKeys "{ENTER} <--- if I comment this out then it doesn't loop

For some unknown reason the remote.exe window does not become the top most application launched.
I don't know if remote.exe is calling an EXE or a DLL or something, I don't know enough about it and I have not found any documentation on it either.

(in reply to ehvbs)
 
 
Post #: 15
 
 RE: Cannot find Error in Script - 1/11/2008 1:40:05 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi twilliamsen,

I'm reduced to Voodoo here - but did you try to use .AppActivate to focus
the correct window?

(in reply to twilliamsen)
 
 
Post #: 16
 
 RE: Cannot find Error in Script - 1/11/2008 1:54:18 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
No, I have not, and have no idea on how to use it or where to put it... 

Without you going to write the code for me, let me look it up first :)

(in reply to ehvbs)
 
 
Post #: 17
 
 RE: Cannot find Error in Script - 1/11/2008 1:57:00 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi twilliamsen,

that's the spirit!

(in reply to twilliamsen)
 
 
Post #: 18
 
 RE: Cannot find Error in Script - 1/11/2008 2:02:35 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
Ok, I got the appactive to work...

Is there a way to call a class in an application? 

The class for the remote.exe I need is called smsRemoteControl in this HTA or is becoming outside the boundries of the HTA and VBS?

(in reply to ehvbs)
 
 
Post #: 19
 
 RE: Cannot find Error in Script - 1/11/2008 2:13:18 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi twilliamsen,

I don't understand "call a class in an application"; I can't find
"smsRemoteControl" in the .hta code posted.

(not complaining or chiding you; just need help to try
to help you)

(in reply to twilliamsen)
 
 
Post #: 20
 
 
Page:   [1] 2   next >   >>
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> [RESOLVED]Cannot find Error in Script Page: [1] 2<