MagicAndre1981 Posted February 25, 2010 Share Posted February 25, 2010 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.vbsNow copy the file to your Windows folder.Now you can sudo cmd.exe to easily start a command prompt with admin rights. Link to comment Share on other sites More sharing options...
MrJinje Posted February 25, 2010 Share Posted February 25, 2010 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 sudoWindows 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now