LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is there a way to type a command to the command prompt using system exec.vi with admin rights when I do not have admin rights myself?

Solved!
Go to solution

I am trying to send a command to the cmd prompt in labview with the system exec.vi and I am able to type the command in labview and get the result in labview. My only problem is the command that I am trying to send requires admin rights to be able to work and I do not have admin rights and my place of work. I was wondering if there is a way that I could bypass that and run a command prompt in labview with admin rights or do it with some outside program so that everytime I run labview, the command has already been sent?

0 Kudos
Message 1 of 7
(3,600 Views)

Hi KovAcevich,

 

you should talk with your IT admin(s) about this topic.

There's a reason you don't have admin rights. When your program needs these access rights the admins should give them to you!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(3,597 Views)

It sounds to me as though you are asking if there is a "back door" by which you can run elevated processes in Windows.  If there were such a thing, the Virus Writers would have a field day, and Microsoft would almost certainly face a tremendous backlash.  That is the whole idea of "rights" -- if you don't have them, and don't have to "right" to give them to yourself, you won't get them.

 

Bob Schor

0 Kudos
Message 3 of 7
(3,592 Views)

I suppose I did not word my question the best. I am wondering if I would be able to make a step, that executes when the computer starts up, where a command would be sent with admin right to the cmd prompt. If I were able to have something like this set up and have an admin sign in to allow this step when I log in, that would be preferable. I heard that maybe you could do something like this with task scheduler but I am unsure how I would do that? I am also open to other suggestions. And then again it may just be that I would need to take to my IT dept, but if there is a solution otherwise, like I mentioned in this post, that would be easier I think.

0 Kudos
Message 4 of 7
(3,585 Views)

*to have someone with admin rights, to sign in, create the step, so that it runs everytime the computer starts up, so that when I start the computer and log in, the action has already ran and the command has been sent to the cmd prompt.*

0 Kudos
Message 5 of 7
(3,584 Views)
Solution
Accepted by topic author KovAcevich7

Hi KovAcevich,

 

create a LabVIEW executable. Have this executable running as a service with admin rights.

Then communicate with this service using TCP/IP communication. Let this service call the cmd shell…

 

I'm not an expert for UAC on modern Windows versions, maybe even then the UAC might interfere this procedure.

 

Again: your IT admins should know how to start processes with admin access rights. Talk to them…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(3,578 Views)

That's the whole idea of services. They run in the background in context that is not a normal user account, but rather with system or similar privileges. That is not exactly like the administrator but sufficiently high enough elevated that it can actually access system resources that are otherwise limited to administrators.

 

And because such a service can do pretty much everything to the computer, you do need administrator rights to install, start, stop and remove them. Once it's installed and started up (which can be set to startup automatically) you do not need any administrator rights anymore.

 

Obviously you do want to limit the things this service does to the absolute minimum possible actions, since they are running in a context where they can do pretty much everything to the machine. And it would be nasty if an unautheticated attacker could access this service and cause it to run code that he injects into it.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 7
(3,511 Views)