Advertisement
Guest User

Untitled

a guest
Apr 17th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Option Explicit
  2. Dim WshShell, theCalculator
  3. Dim a, a1, a2
  4.  
  5. Set WshShell = WScript.CreateObject("WScript.Shell")
  6. a = InputBox(a, "Enter first  operand")
  7. a2 = InputBox(a2, "Enter sign")
  8. a1 = InputBox(a1, "Enter second operand")
  9.  
  10. Set theCalculator = WshShell.Exec("calc")
  11.  
  12. WScript.Sleep 500
  13. WshShell.AppActivate theCalculator.ProcessID
  14.  
  15. WScript.Sleep 500
  16.  
  17. Select Case a2
  18.  
  19. Case "+"
  20. WshSHell.SendKeys a & "{+}"
  21. Case "-"
  22. WshSHell.SendKeys a & "{+}"
  23. Case "/"
  24. WshSHell.SendKeys a & "{/}"
  25. Case "*"
  26. WshSHell.SendKeys a & "{*}"
  27.  
  28. end select
  29. WScript.Sleep 100
  30.  
  31. WshShell.SendKeys a1
  32.  
  33. WScript.Sleep 100
  34.  
  35. WshShell.SendKeys "~"
  36.  
  37. WScript.Sleep 100
  38.  
  39. WshShell.SendKeys "^c"
  40.  
  41. WScript.Sleep 100
  42.  
  43. WshShell.AppActivate theCalculator.ProcessID
  44.  
  45. WshShell.SendKeys "%{F4}"
  46.  
  47. WshShell.Run "notepad"
  48.  
  49. WScript.Sleep 1000
  50.  
  51. WshShell.AppActivate "notepad"
  52.  
  53. WshShell.SendKeys a
  54.  
  55. If a2="+" then
  56. WshSHell.SendKeys "{+}"
  57. else
  58. WshShell.SendKeys a2
  59. End If
  60.  
  61. WshShell.SendKeys a1 & "="
  62. WshShell.SendKeys "^v"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement