Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript function that utilizes "Net Send"?

    What I'd like to do is have a link on a desktop so that when someone opens it, all they have to do is type the computer name and the message and hit a send button. The reason for this is the systems are locked down so nobody can get to the command prompt or the run line and I'd like to be able to give them access to Net Send without giving them any other extra access.
    I know this can be done with javascript but I don't know enough to get the function to work.
    Can someone help me out here?


    Thanks everyone.

  • #2
    New Coder
    Join Date
    Jun 2002
    Location
    Northern California
    Posts
    50
    Thanks
    2
    Thanked 0 Times in 0 Posts
    unfortunately this can't be done in javascript (at least as far as I know. I did something like this).

    I used cold fusion to do this exact thing because... well because im too lazy to goto the command line and type it all out.

    You need some way to execute an external program.

    CFM Code below...
    Code:
    <cfif IsDefined("msg") AND #msg# GT '' AND IsDefined("user") AND #user# GT ''>
    <CFEXECUTE NAME="c:\winnt\system32\net.exe" 
    arguments=" send #user# #msg#">
    </CFEXECUTE>
    <cflocation url="netsend.cfm">
    </cfif>
    <form action="netsend.cfm" method="post">
    User: <input type="text" name="user" value="eblake"><br>
    Msg : <input type="text" name="msg"><br>
    <input type="submit">
    </form>
    Just calls itself with the variables it needs to process.
    Hope this helps some.

  • #3
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm pretty sure it can be done.
    There is an intranet site here that has exactly what I'm trying to do.
    I hit view source and he's got a function called "sendmessage"
    The function isn't define in the source on that page though and I don't know enough about html or web design to find it.

  • #4
    New Coder
    Join Date
    Jun 2002
    Location
    Northern California
    Posts
    50
    Thanks
    2
    Thanked 0 Times in 0 Posts
    look for something like <script src="xxxxx.js"> then try looking at that file. If they have a way to do it with Javascript i would be interested in seeing it.

  • #5
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Using ActiveX and WSH, you can run exe files on a local computer... as long as the user allows ActiveX to run.

    You can do the same in NS3+ (maybe 4+?) by enabling privileges in netscape.security.privilegeManager and running an appropriate Java method through LiveConnect.

  • #6
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The src line was this
    src="techtool.inc"

    I don't know anyting about activex or wmh or cold fusion for that matter. Sorry.


    What would an inc file be?

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    An .inc file could contain anything, but in your case it's most likely that it contains valid js code. Have you tried opening techtool.inc in your browser, that should give you it's contents either directly or as a download.

    Why don't you ask the maintainer of this script, since it is on your intranet? They should know best what parts where used to make it run.

  • #8
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That would seem like the easy answer Mo, I tried emailing the guy and asking for a copy of it, but he hasn't responded to that or my voice mail.
    I did open that inc file though.

    function sendmessage() {

    open ("netsend.asp?host=" + document.runquery.sendhost.value + " " + document.runquery.sendtext.value,"","alwaysRaised,dependent,height=50,width=300")
    }

    That means it's done with server script right? the asp file?
    Is there a way for me to get a copy of that file or code if its in an asp file?

  • #9
    New Coder
    Join Date
    Jun 2002
    Location
    Northern California
    Posts
    50
    Thanks
    2
    Thanked 0 Times in 0 Posts
    unfortunately if you dont have direct access to the file i dont think there is anyway to get the actual source for the asp file itself. you could try running that asp file directly and see if you can view source but I dont know if they would be much help.

    Maybe a mod can move this to the asp forum and they can tell you how to run an external program with asp. My asp skills are sub par.

  • #10
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    you can download free asp component that can run dos & windows apps. they called it AspExec. you can see it at http://www.serverobjects.com/products.htm at the bottom part.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •