# Script Assistance w/ system.util.execute()

**URL:** <https://forum.inductiveautomation.com/t/script-assistance-w-system-util-execute/96940>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [October 8, 2024, 1:17am UTC](https://forum.inductiveautomation.com/t/script-assistance-w-system-util-execute/96940 "2024-10-08T01:17:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathan\_Jay](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@Nathan\_Jay](https://forum.inductiveautomation.com/u/Nathan_Jay)\
**Post date:** [October 8, 2024, 1:17am UTC](https://forum.inductiveautomation.com/t/script-assistance-w-system-util-execute/96940/1 "2024-10-08T01:17:13Z")

</div>

Hello, I am an intern working in ignition right now on a small project and was wondering if I could get some clarity/assistance with a specific issue I am having. Basically, in this project I have a command that is stored as a string, and I need to open up the command prompt and send it. I know the command works on its own within command prompt and I am also able to open command prompt using system.util.execute(), but for some reason I cannot combine the two. I have tried  
system.util.execute(["cmd.exe", "/C", command]) as well as other solutions like ["C:\Windows\System32\cmd.exe", "/C", command] but just cannot get it to work. I think that the script is finding an issue with the command as it first starts off with a file path and then has a "-a" after the file path. I know that the issue starts with the -a as I can get the script to run, open cmd, and then find the file in the file path. The "-a" is what causes it to be unusable. I have tried everything.

For clarity I am running this:  
command = "ExampleFilePath" -a "OtherInfo"  
system.util.execute(["C:\Windows\System32\cmd.exe", "/C", command])

Thank you!

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [October 8, 2024, 1:22am UTC](https://forum.inductiveautomation.com/t/script-assistance-w-system-util-execute/96940/2 "2024-10-08T01:22:12Z")

</div>

You need to enclose the entire command string inside single quotes. You may even have to escape the double-quotes, but I would try without escaping them.

For example your example should be like this:

```python
command = '"ExampleFilePath" -a "OtherInfo"'
system.util.execute(["C:\Windows\System32\cmd.exe", "/C", command])

```

Otherwise without the extra single quotes it isn't reading it as a single string but 2 separate strings separated by a `-a` which is probably causing your error.

Also, next time, put your code in a preformatted text block to make it look cleaner.
