5 Windows alternatives to the Linux sudo command

5 Windows alternatives to the Linux sudo command

If you ever used Linux or know someone using Linux, then you probably heard about the sudo command. The command is a critical component for almost all Linux distributions and what it does is allow you to execute a command as a different user, especially the user raz. On certain Linux distributions, you can log in as root user using the command its, but this is considered highly risky and nobody does.

Actually, it is so dangerous that it is disabled by default in Linux distributions such as Ubuntu. Instead, you must use the command sudo if you want to execute a command as root user. So what about Windows? Well, unfortunately, most people log in to Windows as administrators, which is the same as a root user in Linux. However, Microsoft has tried to reduce the dangerous effects of logging in as Administrator by enabling User Account Control or UAC.

That way, even if the user has administrative privileges, applications running under that account will not inherit those privileges unless the user manually authorizes it. This helps prevent malware and spyware from infecting a Windows user who has logged on as an administrator.

So, while Linux users have the sudo command, what do Windows users have? Are there alternatives that Windows users can use to execute commands with elevated privileges? Is there a sudo command for Windows? In this article, talk about five alternatives to the sudo command for Windows users.

Note : Some of these tools are quite old now, so they may or may not work with the latest versions of Windows.

Windows Runes Command

Windows has the command runes, which is the direct counterpart of sudo in Linux. Using the runas command, you can execute a script, program or command as a different user or as an administrator. The complete syntax for the runes command is:

 runas (/ profile) (/ env) (/ netonly) (/ smartcard) (/ showtrustlevels) (/ trustlevel) / user: programa UserAccountName 

If you want to open an administrative command prompt, you can type the following:

 runas / noprofile / user: Administrator cmd 

/ noprofile does not load the current user profile. You can eliminate that if you need to access the user environment variables. If you want to open a text file with Notepad with administrator privileges, you can use this command:

 runas / usuario: Administrador "notepad my_file.txt" 

You can check the Technet page in runes for more information on how to use it.

Note that when using the runes command, if you install a program or make changes to the configuration, etc., the changes will be made to the user account in which you are executing the command. For example, suppose you have an X user who is a normal user and a Y user, who is an administrator. If you log in to X and then run with the administrator credentials, changes will be made to the administrator settings, not the user X.

Therefore, if you install an application by right-clicking on the EXE file and selecting Run as administrator, it will be installed in the user profile Built-in Administrator, not the one you started. If you want true elevated privileges such as sudo without profile problems, see the following alternative below.