Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


MagicAndre1981

SuDo equivalent for Windows Vista/7

Recommended Posts

Have you ever wanted to run a program from command line with admin rights under Vista/7?

The solution is a sudo clone.

Start notepad.exe and copy the following text into a new text file and save it as sudo.cmd:


@echo Set objShell = CreateObject("Shell.Application") > %temp%\sudo.tmp.vbs
@echo args = Right("%*", (Len("%*") - Len("%1"))) >> %temp%\sudo.tmp.vbs
@echo objShell.ShellExecute "%1", args, "", "runas" >> %temp%\sudo.tmp.vbs
@cscript %temp%\sudo.tmp.vbs

Now copy the file to your Windows folder.

Now you can

sudo cmd.exe

to easily start a command prompt with admin rights.

Share this post


Link to post
Share on other sites

Neat script, but what about this. According to Wikipedia, using the RunAs command is similar to running the "SU" command from linux, not SUDO.

Runas, su and sudo

Windows has a command runas which has similar functionality, but neither runas nor UAC are sudo, they impersonate another user rather than privilege escalation.

Runas and su:

* do not allow authorized users to launch processes with elevated privileges using their own passphrase.

* do not preserve the user's profile and ownership of created objects.

The runas command is (more or less) equivalent to Unix su, not sudo. The reason sudo is superior to su is that it allows privilege escalation based on the user’s own identity, and most importantly does not require use of a shared password. Using runas or su to access a privileged account requires distribution of a password to an admin-capable account, a security weakness that sudo does not have.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...