TestComplete Tip: How to execute an OS command programatically

Sometimes it's necessary to execute an OS command via the system Run dialog. This dialog can be opened by pressing the Start button and then selecting the 'Run...' item from the Start menu. However, simulating these actions as clicks and keystrokes in a script is not very fast or convenient. I recommend using the following routine that executes commands programmatically.

If the command fails for some reason, an error will be generated and its number and description will be posted to the log. Note that not all errors have a description.


Close

By submitting this form, you agree to our
Terms of Use and Privacy Policy

Thanks for Subscribing

Keep an eye on your inbox for more great content.

Continue Reading

Add a little SmartBear to your life

Stay on top of your Software game with the latest developer tips, best practices and news, delivered straight to your inbox