English 中文(简体)
Can 我确定Matlab是否与Windows的更高特权一样运作?
原标题:Can I determine if Matlab is running as with elevated privileges in Windows?

我愿发现,目前的马特拉布会议是否在视窗下使用更高的特权(即用户开始使用“担任署长”)。 理想的做法是,解决办法将在XP和Windows 7上发挥作用,但我很乐于在必要时拿出两种解决办法。

* E/CN.6/2009/1。 回答表明,我可能通过我所需要的信息。 马塔布(至少为Vista和后来)的净外部接口,但我很想知道,是否有一个更具“本地”的马塔布解决办法。

最佳回答

“Matlab .NET桥”是用其他方式——从Matlab起。 NET。 电话: 从Matlab开始的网络班可直接使用。 NET外部接口支助。

function out = isWindowsAdmin()
%ISWINDOWSADMIN True if this user is in admin role.
wi = System.Security.Principal.WindowsIdentity.GetCurrent();
wp = System.Security.Principal.WindowsPrincipal(wi);
out = wp.IsInRole(System.Security.Principal.WindowsBuiltInRole.Administrator);

That should work on any Windows version with .NET installed. The more "native" way would probably require writing a MEX to call win32 API functions, which would be more work. Works on my XP machine.

问题回答

暂无回答




相关问题
Why running a service as Local System is bad on windows?

I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...

Programmatically detect Windows cluster configuration?

Does anyone know how to programatically detect that a Windows server is part of a cluster? Further, is it possible to detect that the server is the active or passive node? [Edit] And detect it from ...

get file icon for Outlook appointment (.msg)

I ve read Get File Icon used by Shell and the other similar posts - and already use SHFileInfo to get the associated icon for any given extension, and that works great. However, Outlook uses ".msg" ...

Identifying idle state on a windows machine

I know about the GetLastInputInfo method but that would only give me the duration since last user input - keyboard or mouse. If a user input was last received 10 minutes ago, that wouldn t mean the ...

Terminating a thread gracefully not using TerminateThread()

My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...

热门标签