LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the SE_SHUTDOWN_NAME privilege?

How do I set the SE_SHUTDOWN_NAME privilege so that I can execute ExitWindows on LabView 6.1 / Windows 2000?

KnowledgeBase document 2CTJ76G4 says that "a CIN is used to set the necessary privilege": what function / DLL?

(The attachment to KB #2CTJ76G4 is for LV 7.0; I am running 6.1.)
0 Kudos
Message 1 of 3
(6,267 Views)
Hi,

You don't need a CIN, just the right calls to advapi32.dll and kernel32.dll:

LookupPrivilegeValueA
GetCurrentProcess
OpenProcessToken
AdjustTokenPrivileges
ExitWindowsEx

But it's easier to use the attached vi... Be carefull. Windows will shut
down (save first)!

Regards,

Wiebe.


"allenf" wrote in message
news:5065000000080000009DD80000-1079395200000@exchange.ni.com...
> How do I set the SE_SHUTDOWN_NAME privilege so that I can execute
> ExitWindows on LabView 6.1 / Windows 2000?
>
> KnowledgeBase document 2CTJ76G4 says that "a CIN is used to set the
> necessary privilege": what function / DLL?
>
> (The attachment to KB #2CTJ76G4 is for LV 7.0; I am running 6.1.)



[Attachment Shutdown.vi, see below]
Message 2 of 3
(6,266 Views)
Thanks! That looks like it will do the trick!
0 Kudos
Message 3 of 3
(6,266 Views)