# Calling system commands from CAL code

**URL:** <https://www.dynamicsuser.net/t/calling-system-commands-from-cal-code/6271>\
**Category:** Developers Forum\
**Created:** [September 5, 2002, 10:08pm UTC](https://www.dynamicsuser.net/t/calling-system-commands-from-cal-code/6271 "2002-09-05T22:08:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paris](https://avatars.discourse-cdn.com/v4/letter/p/b9e5f3/32.png) [@paris](https://www.dynamicsuser.net/u/paris)\
**Post date:** [September 5, 2002, 10:08pm UTC](https://www.dynamicsuser.net/t/calling-system-commands-from-cal-code/6271/1 "2002-09-05T22:08:55Z")

</div>

I know that system commands can be called from Navision by running them from a menu option or button by setting the PushAction property to RunSystem and setting the RunCommand property to call the program that we need to run. For example, user wants to use the software SmartSketch to print the drawing of a BOM. The command is: "c:\program files\smartsketch\smartsketch.exe /p /q " “\serverp\hp4000nofc” /c1 “test2.igr” Can this be done from within CAL code instead of the properties of the menu option/button? I have a button called Print Shop Documents. The code in the OnPush trigger of the button prints a couple of documents by running Navision reports. I need it to, after printing the reports, call Smartsketch to print the drawing that is saved in a file. The file name(with the path) should be a variable. Thanks. Pari Somasundaram

---

<div class="post-metadata">

**Author:** ![ohlfert](https://avatars.discourse-cdn.com/v4/letter/o/e9c0ed/32.png) [@ohlfert](https://www.dynamicsuser.net/u/ohlfert)\
**Post date:** [September 5, 2002, 11:16pm UTC](https://www.dynamicsuser.net/t/calling-system-commands-from-cal-code/6271/2 "2002-09-05T23:16:16Z")

</div>

You could use the “shell” command from within code.

---

<div class="post-metadata">

**Author:** ![Rajeshj](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@Rajeshj](https://www.dynamicsuser.net/u/Rajeshj)\
**Post date:** [September 6, 2002, 11:18am UTC](https://www.dynamicsuser.net/t/calling-system-commands-from-cal-code/6271/3 "2002-09-06T11:18:30Z")

</div>

Hi, You can use the CAL code mentioned below SHELL("c:\program files\smartsketch\smartsketch.exe /p /q " “\serverp\hp4000nofc” /c1 “test2.igr”);

---

<div class="post-metadata">

**Author:** ![Graham](https://avatars.discourse-cdn.com/v4/letter/g/4af34b/32.png) [@Graham](https://www.dynamicsuser.net/u/Graham)\
**Post date:** [September 6, 2002, 1:08pm UTC](https://www.dynamicsuser.net/t/calling-system-commands-from-cal-code/6271/4 "2002-09-06T13:08:57Z")

</div>

Or by using Automation control. Not all applications are written to allow this. This is where you can make an internal link from your code unit to the application and then control that application from Navision. Regards Graham
