# Excecute a MSDOS command from NAV

**URL:** <https://www.dynamicsuser.net/t/excecute-a-msdos-command-from-nav/23432>\
**Category:** Developers Forum\
**Created:** [November 6, 2009, 12:03pm UTC](https://www.dynamicsuser.net/t/excecute-a-msdos-command-from-nav/23432 "2009-11-06T12:03:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cnbjork](https://avatars.discourse-cdn.com/v4/letter/c/ecc23a/32.png) [@cnbjork](https://www.dynamicsuser.net/u/cnbjork)\
**Post date:** [November 6, 2009, 12:03pm UTC](https://www.dynamicsuser.net/t/excecute-a-msdos-command-from-nav/23432/1 "2009-11-06T12:03:18Z")

</div>

Hi!

Is there any way to excute an MSDOS command with parameters (.NET Console Application) form a Dynamis NAV 5.0 form?

ie. “C:\SMSServer\sendSMS 555632050 Excelltia DEMO TEXT FROM SMSSERVER”

Thank you ver much!

Carlos

---

<div class="post-metadata">

**Author:** ![DaveT](https://avatars.discourse-cdn.com/v4/letter/d/958977/32.png) [@DaveT](https://www.dynamicsuser.net/u/DaveT)\
**Post date:** [November 6, 2009, 12:35pm UTC](https://www.dynamicsuser.net/t/excecute-a-msdos-command-from-nav/23432/2 "2009-11-06T12:35:10Z")

</div>

Hi Carlos,

Use the SHELL command

---

<div class="post-metadata">

**Author:** ![cnbjork](https://avatars.discourse-cdn.com/v4/letter/c/ecc23a/32.png) [@cnbjork](https://www.dynamicsuser.net/u/cnbjork)\
**Post date:** [November 6, 2009, 12:51pm UTC](https://www.dynamicsuser.net/t/excecute-a-msdos-command-from-nav/23432/3 "2009-11-06T12:51:20Z")

</div>

Thanks Dave! Will try !

---

<div class="post-metadata">

**Author:** ![sander7](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sander7](https://www.dynamicsuser.net/u/sander7)\
**Post date:** [November 6, 2009, 1:03pm UTC](https://www.dynamicsuser.net/t/excecute-a-msdos-command-from-nav/23432/4 "2009-11-06T13:03:46Z")

</div>

Hi Carlos,

Like Dave suggests you can use the SHELL command.  
I’ve had some issues with it though, so i always use Windows Script Host Object Model.

If you define a variable of type Automation:  
WshShell - Automation - ‘Windows Script Host Object Model’.WshShell  
It has a method called RUN, that takes 3 parameters.

1. is the path to the executable or what ever you want to run.  
(Note to prevent security warnings you have to put the path of the file in a text-var)

Try to search for WshShell in the forum, and i’m sure you’ll find a lot of threads on this.
