Sudo on windows - windows

Hey I ran into the error of BSOD 0xc000021a and I already found some solutions using the „emergency commandline“ at X:/Windows when running into recovery Options.
Sadly it is constantly disallowing me to use Commands Bc of Not enough permissions. I know the Password and got a Windows shell but not the option to Right click for executing as admin.
Any help is deeply needed. Thank you in advance!

There is no sudo command in Windows. The nearest equivalent is "run as administrator."
You can do this using the runas command with an administrator trust-level, or by right-clicking the program in the UI and choosing "run as administrator."

Related

"sudo su" equivalent in windows

I've seen multiple questions on this topic and some answers about runas but none of them was sufficient...
I need a Windows command to upgrade privileges of a terminal after it has already been opened with permissions of an average user. ie. To upgrade permissions for the whole terminal session and not just to run one command as administrator! Something just like sudo su in Linux.
If anyone knows any trick to do this that would be much appreciated.
Edit:
Why I need this? I use the terminal in Visual Studio Code; it wouldn't let me run commands that require administrative permissions. It sucks to have to open an external terminal to do this... And currently, the only way I'm aware of to run a terminal in VS code in elevated permissions would be by editing the Code.exe's compatibility settings to run as administrator. But that adds more trouble because now it shows the user account control prompt every time I run an instance of VS Code.
Also creating a special shortcut to run VS Code in administrative mode wouldn't help because I run it from the context menu (Open With Code) so I don't have to manually navigate to the project folder.
There is no such an equivalent in Windows.
What you might do is to open your desired process from cmd with:
runas /user:administrator processname.
or open any application with right-click and run as..

Problems Getting Battery Stats from Command line

I am having Problems Getting Battery Stats from Command line. So the command that I have been running in PowerShell(yes as Admin) is powercfg -energy and the error generated is
The Power Efficiency Diagnostic library (energy.dll) could not be loaded
So then I was told that I should make sure the file was correct version with sfc /scannow and generates the error
Windows Resource Protection could not start the repair service
So then I check Windows Modules Installer service with service.msc and it is set to Manual
Any Insight is appreciated, Thanks
The problem was that i was running it in powershell. It works fine if I run it in command prompt. Thanks for the help

Have tried all traditional troubleshooting: "Can't find script engine "VBScript" for script..."

I've done all the traditional fixes in every major threads related to this problem and I still get this error. I'm trying to run a .vbs to install a webdisk onto my computer. (Please note that I'm not a programmer so I'm hoping to receive help in Layman's terms.)
I've gone into registry and fixed the HKEY to list the .dll.
I've deleted all cleaners and adblockers and anti-virus programs.
I've created a new .reg that merged threads.
Please help. I'm going crazy up here at the lake.
Cheers.
Please follow the following steps:
Open command prompt as Administrator using Run As Administrator
Now type sfc /scannow and press enter.
Check the message that you get and take the corresponding action as mentioned here.
You can also try doing the following:
Run regsvr32 vbscript.dll and regsvr32 jscript.dll in command prompt as administrator.
Also run the Windows Cleanup Utility as Administrator.
This should fix your issue.

installation using msi.exec open help options every time

I have been trying to install a msi file using cmd. The command looks like
C:\Windows\system32>msiexec.exe -q -i "Installer.msi"
But every time I run this the window for help options is opened for msi instead of running the installer. What could be the problem?
First, you need to specify the full path to the MSI file. Also, the command line is really picky if you are specifying anything else, and sometimes it doesn't like spaces between value=proprtyname. Those errors will give you the help screen because you got the syntax wrong in some way.
Note that the MSI file will not install successfully in silent mode if it requires elevation. It won't ask for the elevation prompt if you are in silent mode. That means you should try the command line install from an elevated prompt.
I think msiexec.exe /i installer.msi /qn should work.
See here for a similar thread on serverfault: https://serverfault.com/questions/30068/silent-install-of-msi/67001#67001
To deal with the complicated msiexec.exe command line interface, try this free tool from Installation tool developer Altiris: http://www2.wise.com/filelib/WICLB.exe - broken link resurrected from Wayback machine. Seeing as the tool was freeware I assume that is legal.
Please run the download by virustotal.com for safety.
Here is a screenshot:

ActiveMQ install issue

I am running win7 professional 64-bit. I have already installed java, and am trying to install ActiveMQ. The install worked perfectly on a Windows Server 2003 machine but now it is giving me issues on my win7 machine. I download ActiveMQ 5.3.2 extract the files and then try to run the installservice.bat file as administrator and it gives me the following error in command prompt: '"wrapper.exe"' is not recognized as an internal or external command, operable program or batch file.
I had the same issue when using Windows Explorer and right clicking on the InstallService.bat file and selecting "Run As Administrator".
However, this worked for me (without having to change my user control settings):
1) Open a command prompt (right clicking first with "run as administrator").
2) Then navigate to the folder where your batch file is and simply type InstallService.bat.
Ok I feel a little stupid answering my own question but here it goes. Turn off the user control settings in the control panel
I had the same issue with apache-activemq-5.6.0 and solved it this way:
Open cmd.exe as admin (click on Start, type in cmd, right click on the "cmd" program, and choose Run as administrator)
In the cmd.exe window, navigate to your apache-activemq-5.X.X root dir (which contains bin, conf, data, docs, ...)
From there, navigate to bin\win64
Your commmand prompt should show something like:
...\apache-activemq-5.6.0\bin\win64>
Still in the cmd.exe, run InstellService.bat
It does not work if you run something like win64\InstellService.bat while being in bin. You have to actually navigate to bin\win64 first.
The in case you are installing in win 64 bit 2012 Server too, run InstallService.bat under sys32.
Its little confusing but it works.

Resources