09-18-2015 06:03 PM
I need to shut down my computer when Labview closes. So I wrote a VI that just calls cmd with the line: "cmd /k shutdown -s -f -t 1". Runnnig this from a VI in labview works, it shuts down the computer. But when I try to just build an executable from the file and run it the call doesn't work....the computer doesn't close down.
Any ideas about differences in cmd calls from within LAbview and from an executable made in a Labview project?
09-18-2015 06:09 PM
Just a wild random guess: Does it work differently if you run the executable as administrator (right-click ... run as administrator).
09-18-2015 06:15 PM
Oh man I thought you were on to something there....but nop....still not working from an executable..
Thanks for trying though!
09-18-2015 06:27 PM
the help states that you should be using \c instead of \k
09-18-2015 11:24 PM
I agree with crossrulz in which the /k is most likely the cause of your issue. Try removing the "cmd /k" altogether and just type "shutdown -s -f -t 1". I have successfully ran this code on an executable deployed on a Windows 7 embedded device.
Hope this helps.
Cory
09-21-2015 11:30 AM
So strange. It doesn't work for me. So what I did instead was to keep the cmd comand in a VI by it self and from the exe file I call the VI by referense and that made my computer shut down....but if I called the same VI within the exe it doesn't work still....running 2014...
Thanks for all the sugestions though! Don't know what is different in my system for it not to work.
Cheers
HS