Forum Discussion

Anupa's avatar
Anupa
Occasional Contributor
15 years ago

Passing Commands in Command prompt using VB Script

Hi,


I am using TestComplete version 5.15.561.7. Language used is VB Script.


I am automating one test case where in it opens the Command prompt --> changes the directroy to where office 2007 is installed --> and then opening one saved Excel workbook


For example: Call Command_Prompt_Window.Keys("c:[Enter]cd C:\Program Files\Microsoft Office\Office12[Enter]\Excel.Exe ""D:\BookMark.xlsx""[Enter]")


where Command_Prompt_Window = NameMapping.Sys.Process("cmd").Window("ConsoleWindowClass", "*")


While playbacking the script, the data passed as ("c:[Enter]cd C:\Program Files\Microsoft Office\Office12[Enter]\Excel.Exe ""D:\BookMark.xlsx""[Enter]" is not taken properly.

For example Colon(:) gets typed as ">" and quotes get typed as "@" in the Command Prompt editor


Can any one please tell me how do I automate the script using VB script so that the Colon and the quotes are entered properly in Command Prompt when the script is play back?


Regards,

Anupa


3 Replies