简体   繁体   中英

How to run command in Powershell as a Administrator to installl Weblogic 12c and to overcome its implications as to run as a Administrator

I would like to install Weblogic 12c in my system. But I do have implications. I do carry admin privilege in my local system but do not carry Administrator login password. I tried in Windows 10. And in prior Windows 7 also, but I had the implication of Logged-in User, that he belongs to Administrators Group, but it was not Windows Administrator login.

C:\Users\Sathasivam_Anand\Downloads\fmw_12.2.1.2.0_wls_Disk1_1of1>runas /user:Ad
ministrator "java -jar fmw_12.2.1.2.0_wls.jar"
Enter the password for Administrator:

As per the first answer to this question, I am able to run java which doesn't need any admin privilege, obviously. cmdlets are correct but unclear what I have deal with Runas argument. I am getting following error in PowerShell

PS C:\Users\Sathasivam_Anand\Downloads\fmw_12.2.1.2.0_wls_Disk1_1of1> Start-Proc
ess -Verb Runas "C:\Progra~1\Java\jdk1.8.0_112\bin\java -jar .\fmw_12.2.1.2.0_wl
s.jar"
Start-Process : This command cannot be run due to the error: The system cannot
find the file specified.
At line:1 char:1
+ Start-Process -Verb Runas "C:\Progra~1\Java\jdk1.8.0_112\bin\java -ja ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOp
   erationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.C
   ommands.StartProcessCommand

PS C:\Users\Sathasivam_Anand\Downloads\fmw_12.2.1.2.0_wls_Disk1_1of1>

How do I overcome this situation.

Is there a way by using cmdLets in powershell this situation can managed by using pipes or so if required.

You should be clear that belonging to Administrators Group doesn't mean that I can do programs which requires to be as Administrator that I can run with runas /user:Administrator "command" , obviously wrong answer. Removing right tick hence.

If you can, please clarify as a another Answer.

By using runas /user:Administrator you are telling the computer to run this as the user Administrator, which is very different that running an application with Administrative privileges.

You mentioned that your account has those privileges so either you can run cmd or PowerShell by Right click and selecting "Run as Administrator" which will then likely give the UAC prompt and then everything done in that session will be with Administrative privileges. Otherwise from an unelevated PowerShell window you can run the command Start-Process with the -Verb Runas parameter which will attempt to start that process with administrative rights (likely UAC prompt).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM