• HTA Application

    Author
    Topic
    #433319

    Hi,

    We have a requirement to send keystrokes to some of our Windows XP Pro laptops (to prevent the screen saver, set by Group Policy, from kicking in during presentations). We have easily managed this using WScript, but it isn’t that user friendly. We thought we would use an HTA application instead and have this code…

    *************************

    Sub SendCAPS()
    set WshShell = WScript.CreateObject(“WScript.Shell”)
    WshShell.SendKeys “{CAPSLOCK}”
    End Sub

    *************************

    Our problem is that Windows Script Host methods must execute under Windows Script Host; with HTAs not running in the WSH environment. Thus, our SendKeys method won’t work within the HTA.

    Has anyone got a scripting solution that would work within an HTA (i.e. an equivalent to the SendKeys method that isn’t WSH)?

    TIA,

    Viewing 1 reply thread
    Author
    Replies
    • #1019097

      I have used the FileSystemObject in an HTA, but it was so long ago that browser security restrictions might have changed things…

      One thing to try. Edit out the first WScript in the following line:

      OLD: set WshShell = WScript.CreateObject("WScript.Shell")
      NEW: set WshShell = CreateObject("WScript.Shell")

      • #1019163

        Thank you – that worked beautifully!

        Much appreicated,

    • #1019129

      Can you change the TIME setting, if so set it for the max time you can.

      DaveA I am so far behind, I think I am First
      Genealogy....confusing the dead and annoying the living

    Viewing 1 reply thread
    Reply To: HTA Application

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: