# System.util.perspective TypeError expected 1 args; got 2

**URL:** <https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161>\
**Category:** Ignition\
**Created:** [April 7, 2022, 11:55am UTC](https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161 "2022-04-07T11:55:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 7, 2022, 11:55am UTC](https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161/1 "2022-04-07T11:55:08Z")

</div>

Not sure what’s going on here. When I call something super simple from Perspective button:

```auto
system.util.execute(['notepad.exe'])

```

I get this error:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/7/b73146df518c1c601e32b6ceb5e20bea8fa9507f.png)

(And yes I realise that this will execute on the gateway and it’s not what I want to do. I’m actually trying to execute a batch file but this looked easier)

Any ideas?  
Also, how would I execute a batch file? Do I have to call it through cmd?  
e.g.

```auto
system.util.execute(['cmd', '/c', 'c:/folder/thing.bat'])

```

?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 7, 2022, 11:58am UTC](https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161/2 "2022-04-07T11:58:41Z")

</div>

Actually, it worked… the batch file ran, but it just produced an error for some reason??

Next question, is there any way to run the batch file with admin rights? 🙂 I’m guessing not…

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [April 7, 2022, 12:30pm UTC](https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161/3 "2022-04-07T12:30:49Z")

</div>

Maybe this:  
`Create a bat shortcut, and then right-click the shortcut — > Properties > Advanced — > run as administrator.`

Or if you want to get fancy:  
[How to make bat batch run with administrator’s permission](https://developpaper.com/how-to-make-bat-batch-run-with-administrators-permission/)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 7, 2022, 12:37pm UTC](https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161/4 "2022-04-07T12:37:56Z")

</div>

It’s going to run as the same user as the gateway service. In Linux I would use an SSH key with a program restriction to launch into a target user (even root) to run the script.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [April 7, 2022, 12:50pm UTC](https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161/5 "2022-04-07T12:50:36Z")

</div>

using a shortcut(.lnk) you can not run a batchfile with parameters tho

easiest is to run the gatewayservice as an adminuser

---

<div class="post-metadata">

**Author:** ![martinel3746](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@martinel3746](https://forum.inductiveautomation.com/u/martinel3746)\
**Post date:** [April 7, 2022, 1:45pm UTC](https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161/6 "2022-04-07T13:45:55Z")

</div>

I’ve had best results by writing the .bat file from Ignition before executing it.  
That also guarantees that the content of the .bat file is exactly where and what it is expected to be.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 7, 2022, 2:57pm UTC](https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161/7 "2022-04-07T14:57:41Z")

</div>

> [@victordcq](#):
>
> using a shortcut(.lnk) you can not run a batchfile with parameters tho

Umm... not true  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/7/971a984a12b94ea3d37ed5ef2440cc28ecd6af81.png)

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [April 7, 2022, 2:59pm UTC](https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161/8 "2022-04-07T14:59:54Z")

</div>

and now try  
`test.lnk "lnk params with spaces" "does this work?"`

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 7, 2022, 3:00pm UTC](https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161/9 "2022-04-07T15:00:58Z")

</div>

> [@victordcq](#):
>
> test.lnk "lnk params with spaces" "does this work?"

Yes.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/7/573fc6a5de4f5b84e21dac61fd5c202dea55c368.png)

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [April 7, 2022, 3:02pm UTC](https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161/10 "2022-04-07T15:02:12Z")

</div>

hmm that didnt work for me when i tried it a while ago…  
ah i also had an absolute path to the lnk with spaces

```auto
"test.lnk" "with spaces" "param2"
"C:\Program Files\test.lnk" "with spaces" "param2"

```

and maybe it just didnt go through ignition idk

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 7, 2022, 3:08pm UTC](https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161/11 "2022-04-07T15:08:05Z")

</div>

Don’t know what to tell you.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/5/f5d35ca1cfae32cc8846b28f913b29a1485151ec.png)

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [April 8, 2022, 11:15am UTC](https://forum.inductiveautomation.com/t/system-util-perspective-typeerror-expected-1-args-got-2/58161/12 "2022-04-08T11:15:58Z")

</div>

Weird, i failed a bunch trying that the other week, maybe i did somethingn else wrong xD  
i kept trying to run the lnk with a path to an image as param and it just didnt work but if i used the bat directly it worked fine.

i also found a forum somewhere that they said that params dont work on lnks, idk  
best to test if it works anyways i guess xd

ah maybe its because i ran the cmd from igntion with cmd c/ ? because this seems to happen in the cmdln

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/b/cbfe54ed46de918b15f955c52f8d8fa26f855c71.png)  
Altho that should happen with batfile too idk xD… thats why i avoid spaces as much as possible lol  
i have no idea how it gets to run the batfile tho if it thinks half of the `folder\test.lnk"` is a param xD
