Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005
    Posts
    1

    Unanswered: Need help urgently in send key

    Hi all, i have the following codes

    Dim FSO, FO
    ' Set Objects
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set WshShell = WScript.CreateObject("WScript.Shell")
    wshshell.run "cmd"
    wscript.sleep 50
    Wshshell.sendkeys "dir/w"
    wscript.sleep 50
    Wshshell.sendkeys "~"
    wscript.sleep 50
    Wshshell.sendkeys "%( )"
    wscript.sleep 50

    When i type the code Wshshell.sendkeys "%( )"(trying to do a alt space)
    it does not initate the pull down menu in the cmd prompt.wat is the correct syntax.
    Would appreciate if some body can help.Thanks

  2. #2
    Join Date
    Jun 2005
    Posts
    61

    i Hope this example will help u

    Dim ReturnValue, I
    ReturnValue = Shell("calc.exe", 1) ' Run Calculator.

    AppActivate ReturnValue ' Activate the Calculator.

    For I = 1 To 100 ' Set up counting loop.

    SendKeys I & "{+}", True ' Send keystrokes to Calculator

    Next I ' to add each value of I.

    SendKeys "=", True ' Get grand total.

    SendKeys "%{F4}", True ' Send ALT+F4 to close Calculator.
    Sami Al Damiri ...

Posting Permissions

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