I am getting the following error when I try to send to send a "(" or ")" character using SendKeys .In my vbscript.
Invalid procedure call or argument
My script:
Set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 100
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Documents and Settings\Administrator\Desktop\readme.txt", 1)
Wshshell.SendKeys "!@#$%^&*()"
Do Until objFile.AtEndOfStream
strCharacters = objFile.Read(1)
WshShell.SendKeys strCharacters
Loop
It does not send the "(" and ")" when I try to send them before the loop but shows no error and continues till a little further where it encounters another "(" character and stops with the error.
Parenthesis are considered a special character and need to be surrounded in braces. See this link for more details.