ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running System Exec as Admin

I am trying to run system exec as admin using a batch file but always get an error saying the command isn't right.

0 Kudos
Message 1 of 10
(5,580 Views)

What does "/r" mean?  I don't see that in the list of options when I run "cmd /?" from the command prompt.

0 Kudos
Message 2 of 10
(5,561 Views)
0 Kudos
Message 3 of 10
(5,544 Views)

It looks like you don't have a space between cmd and /r. You also need to create a shortcut to the command prompt that requires admin rights. See also https://forums.ni.com/t5/LabVIEW/Run-command-prompt-as-administrator-using-system-exec-vi/m-p/290635....

Certified LabVIEW Architect
0 Kudos
Message 4 of 10
(5,543 Views)

I'm still getting the same error

0 Kudos
Message 5 of 10
(5,528 Views)

@nandiouioui wrote:

I'm still getting the same error


The error say's you are still not having a space between cmd and /r.

Certified LabVIEW Architect
0 Kudos
Message 6 of 10
(5,502 Views)

I tried with and without and it doesn't change anything

0 Kudos
Message 7 of 10
(5,494 Views)

I found the error it was because my path file was wrong  https://forums.ni.com/t5/LabVIEW/What-is-Error-Code-267/td-p/23804

0 Kudos
Message 8 of 10
(5,491 Views)

@RavensFan wrote:

What does "/r" mean?  I don't see that in the list of options when I run "cmd /?" from the command prompt.


/R is the same as /C

C:\> cmd /?
Starts a new instance of the Windows command interpreter

CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]
    [[/S] [/C | /K] string]
[ ... (Output shortened) ... ]
/V:OFF  Disable delayed environment expansion.

Note that multiple commands separated by the command separator '&&'
are accepted for string if surrounded by quotes.  Also, for compatibility
reasons, /X is the same as /E:ON, /Y is the same as /E:OFF and /R is the
same as /C.  Any other switches are ignored.
Message 9 of 10
(5,486 Views)

@UliB wrote:

@RavensFan wrote:

What does "/r" mean?  I don't see that in the list of options when I run "cmd /?" from the command prompt.


/R is the same as /C

C:\> cmd /?
Starts a new instance of the Windows command interpreter

CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]
    [[/S] [/C | /K] string]
[ ... (Output shortened) ... ]
/V:OFF  Disable delayed environment expansion.

Note that multiple commands separated by the command separator '&&'
are accepted for string if surrounded by quotes.  Also, for compatibility
reasons, /X is the same as /E:ON, /Y is the same as /E:OFF and /R is the
same as /C.  Any other switches are ignored.

Thanks.  I was only looking at the list and never saw it.  I never looked through the pages of other comments in all those paragraphs.

0 Kudos
Message 10 of 10
(5,469 Views)