1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Javascript Input Box Locks Up

Discussion in 'Web Design & Development' started by IsolatedSnail, Dec 14, 2011.

Thread Status:
Not open for further replies.
  1. IsolatedSnail

    IsolatedSnail Thread Starter

    Nov 7, 2009
    Hello again TSG,

    I am stuck again and hoping that since Google has failed me the experts here can point me in the right direction. I have created a Windows 7 gadget that takes in a string from a textbox and then calls a VBScript from Windows using WScript.exe so that it uses my Windows permissions to run sendkeys. The sendkeys are necessary to create a loop hole around Cisco Smart Tunnel.

    I use this gadget along with several other IT partners to dial out to our servers/workstations via putty, vnc, or remote desktop depending on the parameters entered in the textbox.

    I know that calling WScript.exe is not ideal and probably not at all recommended from a web development stand point, but it was necessary to run the script with the correct permissions for what we needed. The problem I have now is that after certain events, the text input box will lock up and not allow you to type. I assume this is because it is waiting on WScript.exe or something else to return information. The only time the text box locks up is if the script has already been executed and you cancel out before letting it finish by hitting escape.

    I tried to make an ugly workaround by using an event to copy text from one inputbox to another then call the function from the second text box and it still does the same thing except then both text boxes will be locked up.

    Can anyone provide any insight into this ugly development problem? I know none of my circumstances are ideal and are strongly opposed in normal web development but for the purpose of this gadget in my small business scenario calling the vbscript from wscript.exe is really necessary.

    The first block of code is the main html page for the gadget.
    <html xmlns="[URL]http://www.w3.org/1999/xhtml[/URL]">
            <!-- Heading information -->
            <meta http-equiv="Content-Type" content="text/html; charset=Unicode" />
            <!-- Style definitions -->
            <style type="text/css" language="css">
                body {
                    font-family:Verdena, sans-serif;
            <!-- Loads remote javascript into memory. -->
            <script src="dialer.js" type="text/jscript"></script>
            <!-- Loads message vbscript into memory. -->
            <script src="alert.vbs" type="text/vbscript"></script>
            <!-- Loads control vbscript into memory. -->
            <script src="control.vbs" type="text/vbscript"></script>
        <!-- Body of Gadget (html) -->
            <table align="center">
                    <img src="images/logo.png" alt="Remote Gadget"/>
                <!-- hostName input box, accepts input from user to start remote connection. -->
                    <input type="text" id="editHost" name="editHost" size="12" onClick="editHost.value='';"
         maxlength="15" value="Enter Host" onKeyUp="sendHost.value=editHost.value;" />
                    <input type="button" name="Ok" value="Ok" onClick="remote(sendHost.value);" />
                    <input type="button" name="Help" value="Help" onClick="printHelp();" />
                    <input type="button" name="abc" value="abc" onClick="reset();" />
                    <font size="3">Use Admin? </font><input id="cbAdmin" type="checkbox"/>
                    <font size="3">Auto Pass? </font><input id="cbPasswd" type="checkbox"/>
        <input type="textarea" id="sendHost" name="sendHost" size="12" 
                        maxlength="15" value ="Redial Box" onClick="remote(sendHost.value);" />
    The second block of code is the javascript where the Wscript.exe is called.
    if( !useCachedPassword)
                var execute = myShell.run("Wscript.exe \"C:\\Users\\%USERNAME%\\AppData\\Local\\Microsoft\\Windows Sidebar\\Gadgets\\RemoteBGC.gadget\\sendkeys.vbs\" " + keys);
                var execute2 = myShell.run("Wscript.exe \"C:\\Users\\%USERNAME%\\AppData\\Local\\Microsoft\\Windows Sidebar\\Gadgets\\RemoteBGC.gadget\\buildRdp.vbs\" " + thisHost + " " + admin);
    Thanks for any help or insight into the problem you can provide me.
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1031239

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice