When i run it now i get error: ERROR:unknown command [winmgmts:{impersonationLevel]!

And when i use Kix2EXE since i need to distribute the script it somehow always detect that the program is running. And i know it ain't. If i ; out the funktion to check for the running program whole script goes in compiled EXE mode as intended.