473,326 Members | 2,061 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,326 software developers and data experts.

problem with function

Hello to all. This is my first post, and i am very new at this, so please be kind. I have a webpage that is primarily made in perl. i am able to add html code into it (or some other languages as well). all I am trying to do is add a button to take remote control of a pc that is in our list. When I run the following code in Internet Explorer, I get nothing. I don't get anything in Firefox either, but when i look at the Error Console, I get the error "missing ; before statement as soon as i start the code. When i click the button, I get runApp (the name of my function) is not defined. here is my code:

[HTML]<input type="button" name="button1" value="Remote Control" onClick="runApp()" />
<script language="javascript" type="text/javascript">

function runapp()
{
var shell = new ActiveXObject("WScript.shell");
dim strpc
strpc = "pcxxxx"
Set WshShell = wscript.CreateObject("WScript.Shell")
strCommand = """c:\remote\guest\ngstw32.exe"" " & strpc
wscript.echo strCommand
WshShell.Run strCommand
}
</script>
[/HTML]

Like I said, I am very new at this, so please, any help would be appreciated. One more note, where it says strpc = "pcxxxx", I just threw that in for testing. i am actually picking a variable from the page that i am looking to put the button on. if anybody can let me know how i could better have a button that would run the remote control program and pick up the variable from the page so that it just takes remote of the pc. If this is sounding like a bad thing, it's not. We are purchasing a new Help Desk ticket system from Numara, and I wanted to be able to add this function into it. we support thousands of pc's, so this should make it easier. thank you for any help you can give me. If I have posted this in the wrong forum, please let me know. Thank you all!

Dave
Sep 28 '07 #1
3 1194
gits
5,390 Expert Mod 4TB
hi ...

welcome to TSDN ...

i added the code tags for you and as we can see ... the problem lies in your strCommand assignment. the double-quotes cannot be mixed that way ... you may use double and single qoutes together or you have to escape the quotes inside a string ...

kind regards
Sep 28 '07 #2
acoder
16,027 Expert Mod 8TB
I think you're mixing vbscript and JavaScript. Your code needs to be converted into JavaScript or at least JScript.

Another problem is that you're using ActiveX which will only work in IE.
Sep 28 '07 #3
Thank you for getting back to me. I don't know much at all about vb or javascript. I just know that I needed a button to do that, and I grabbed bits and pieces from the internet. I did have something similar to my script above working, but it wouldn't grab the variable. Since then, I have lost that script. I was so mad that I didn't back it up. If anybody can give me some direction on which way would be the best way to do this, I would appreciate it. Thank you again.

Dave
Sep 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Emanuel Ziegler | last post by:
Hello, I want to do some mathematics with functions. In my case the function classes are very complex, but this simple example has the same problems. To allow calculations that begin with a...
78
by: Josiah Manson | last post by:
I found that I was repeating the same couple of lines over and over in a function and decided to split those lines into a nested function after copying one too many minor changes all over. The only...
5
by: jbenner | last post by:
I have opened a PMR for this with IBM, and am not asking for advice from the DB2 DBA community. I am posting this as an FYI that DB2 Health Monitor, even at the latest version of DB2, still can cause...
2
by: Ravikiranreddy | last post by:
Hi every one, Am pasting the error code returned in log please help me in fixing it--- ERROR:An error occurred during the execution of the command "/opt/IBM/db2/V8.1/instance/dascrt -u...
6
by: pauldepstein | last post by:
Let double NR( double x, double(*)(const double&) f ) be the signature of a Newton-Raphson function NR. Here, f is a function which returns a double and accepts a const double&. The aim of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.