LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I shutdown my computer programmatically through LabView? lab

You are right, shut down is not standard on all windows system but it is
basic component of all nt systems, like I sad. by the way on unix platform
it is also a common way
to remote shutdown or shedule shutdown your system.
SeShutDownPrivelige is what I meant concerning the shutdown api... indeed it
is very simple.

"Wiebe@AIR" wrote in message
news:3e3a6e08$0$121$e4fe514c@dreader4.news.xs4all.nl...
> Well, I get:
>
> 'shutdown' is not recognized as an internal or external command, operable
> program or batch file.....
>
> So this is probably a feature that is not standard.
>
> It's not that difficult to get the SeShutdownPrivilege with
> AdjustTokenPrivileges...
>
> Regards,
>
> Wiebe.
>
>
>
> "Sebastian Dau" wrote in message
> news:3e3927ae$0$205$4d4ebb8e@read.news.de.uu.net...
> > Just write a dll that uses the shutdown api (relatively easy) in c++ or,
> if
> > you'r using a win nt system, just call a command line feature
> (shutdown -s).
> > there are some tips according a command line call by using labview.
> >
> > "Wiebe@AIR" wrote in message
> > news:3e34f70a$0$151$e4fe514c@dreader8.news.xs4all.nl...
> > > Hi,
> > >
> > > Actually, the user might have the rights to shutdown the PC, the
program
> > > doesn't. A logout is allowed, because this does not require services
to
> > > stop.
> > >
> > > A program can get the rights to shutdown the PC. It's not easy (lot's
of
> > > complicated VI's), but it can be done from LV. If you drop me a mail,
> I'll
> > > send you the VI.
> > >
> > > Regards,
> > >
> > > Wiebe.
> > >
> > >
> > >
> > > "waldemar.hersacher" wrote in message
> > > news:506500000005000000A7C70000-1042324653000@exchange.ni.com...
> > > > ExitWindows.vi and ExitWindowsEx will not work for a normal user
under
> > > > Win NT, 2000 and XP Professional since a normal user has not the
right
> > > > to shutdown windows.
> > > >
> > > > You have to search in the internet for programs which do this. We
use
> > > > Winexit form http://posum.com which works fine.
> > > > Another way todo this is to write a program of your own. The sample
> > > > source code is in the MSDN examples. You find this under security
> > > > tokens.
> > >
> > >
> > >
> >
> >
>
>
>
0 Kudos
Message 11 of 22
(2,781 Views)
Hi, I can provide you the following file (download the zip file, extract all the files, actually 2 files, within a single folder and run logoff.vi). You can either programmatically (by setting or not a time delay) logoff, reboot and shutdown. The point is that the shutdown option is not fully operating. My OS (win2k) is indeed shutted down but the power supply is not automatically switched off and I get afterwards "Windows is now shutted down, you can turn your computer off" (or something like that). I didn't find better so far!!! If you do, let me know.
0 Kudos
Message 12 of 22
(2,781 Views)
This works fine for win9x and winNT. It doesn't work for WinXP.
I this it has to do with the flag EWX_Force and EWX_FORCEIFHUNG.
What are the values of these flags and how do i has to include them.
I want to perform a shutdown of WinXP home.
0 Kudos
Message 13 of 22
(3,177 Views)
Hi running the shutdown.vi
if either the force option or the logoff option are ticked then my computer only logs off
if i tick the shutdown option it does nothing at all.
 
i'm on xp and sp2.
 
Do i need to change the commands slightly??
does anyone have a different version for me?
 
Chears!
0 Kudos
Message 14 of 22
(2,493 Views)
also, the reboot doesn't work.
so;
reboot and shutdown do nothing,
force and logoff both only logoff.
 
What i need is either the computer to go onto standby, or [what i really want is] shutdown.
0 Kudos
Message 15 of 22
(2,491 Views)

I haven't looked at the attached Shutdown.vi, but you know, a lot changes in 5 years...

I might recommend trying the System Exec.vi to call the "shutdown" command in Windows.  You can find examples of System Exec in Example Finder, and go to a command prompt and type "shutdown /?" for more info about it.

Good luck!

0 Kudos
Message 16 of 22
(2,445 Views)
Chears for the pointer, but i can't find the System Exec.v, either through labview example search, or scanning my whole pc.
Could you post it here? if you can pull it off your dirrectory for me.

We've got no responce if you send the shutdown the command, but we can get it working to log-off.
But no matter what the two parts of the command line are [the two 32bit unsigned integers] they don't seem to do anything.

Has anyone got any examples they could give me?
0 Kudos
Message 17 of 22
(2,435 Views)

I'd suggest using palette search, or searching the LabVIEW Help, to find System Exec.vi.

Here's an example.



Message Edited by Jeff B on 07-02-2008 10:45 AM
Message 18 of 22
(2,429 Views)
Hi,
thanks for the above advice, i'll give it a go in work tomorrow.
Chears!
- which pallate is the exec on? i couldn't find it on a quick run through last thing today.
Thanks you for the support!
0 Kudos
Message 19 of 22
(2,412 Views)
Hi John Pierson,

In the future I would recommend that you create a new thread for the community to better help you, since this one was created back in 2003.  It really does make a difference!

The System Exec.vi is located on the Functions Palette under Connectivity >> Libraries & Executables.

Regards,
Brian A.
National Instruments
Applications Engineer
0 Kudos
Message 20 of 22
(2,368 Views)