Notices: This section not yet converted to new layout. Download stats are rolling back out.

15,544

Downloads

10,258

Downloads of v 1.0.2

6/12/2015

Last update

Sudo

1.0.2

Package test results are passing.

This package was approved by moderator ferventcoder on 10/15/2015.

Used from a command line as e.g. "sudo cmd" or "sudo notepad" to elevate directly from the shell.

To install Sudo, run the following command from the command line or from PowerShell:

C:\> choco install sudo

To upgrade Sudo, run the following command from the command line or from PowerShell:

C:\> choco upgrade sudo

Files

Hide
  • bin\sudo.cmd Show
    @echo off
    
    if "%~1"=="?" goto HELP
    if "%~1"=="/?" goto HELP
    if "%~1"=="" goto HELP 
    
    :: Pass raw command line agruments and first argument to Elevate.vbs
    :: through environment variables.
    set ELEVATE_CMDLINE=%*
    set ELEVATE_APP=%1
    
    cscript //nologo "%~dpn0.vbs" %*
    
    GOTO:EOF
    
    :HELP
    echo  Provides a command line method of launching applications that prompt for elevation (Run as Administrator).
    echo.   
    echo    sudo [command]
    GOTO:EOF
  • bin\sudo.vbs Show
    ' //***************************************************************************
    ' // ***** Script Header *****
    ' //
    ' // File:      Sudo.vbs
    ' //
    ' // Additional files required:  Sudo.cmd
    ' //
    ' // Purpose:   To provide a command line method of launching applications that
    ' //            prompt for elevation (Run as Administrator) on Windows Vista.
    ' //
    ' // Usage:     (Not used directly.  Launched from Sudo.cmd.)
    ' //
    ' // Version:   1.0.1
    ' // Date :     01/03/2007
    ' //
    ' // History:
    ' // 1.0.0   01/02/2007  Created initial version.
    ' // 1.0.1   01/03/2007  Added detailed usage output.
    ' //
    ' // ***** End Header *****
    ' //***************************************************************************
    
    
    Set objShell = CreateObject("Shell.Application")
    Set objWshShell = WScript.CreateObject("WScript.Shell")
    Set objWshProcessEnv = objWshShell.Environment("PROCESS")
    
    ' Get raw command line agruments and first argument from Elevate.cmd passed
    ' in through environment variables.
    strCommandLine = objWshProcessEnv("ELEVATE_CMDLINE")
    strApplication = objWshProcessEnv("ELEVATE_APP")
    strArguments = Right(strCommandLine, (Len(strCommandLine) - Len(strApplication)))
    
    If (WScript.Arguments.Count >= 1) Then
        strFlag = WScript.Arguments(0)
        If (strFlag = "") OR (strFlag="help") OR (strFlag="/h") OR (strFlag="\h") OR (strFlag="-h") _
            OR (strFlag = "\?") OR (strFlag = "/?") OR (strFlag = "-?") OR (strFlag="h") _
            OR (strFlag = "?") Then
            DisplayUsage
    		WScript.Quit
        Else
    		rem WScript.Echo "objShell.ShellExecute """ & strApplication & """, """ & strArguments & """, """", ""runas"" "
            objShell.ShellExecute strApplication, strArguments, "", "runas"
        End If
    Else
        DisplayUsage
        WScript.Quit
    End If
    
    
    Sub DisplayUsage
    
        WScript.Echo "Elevate - Elevation Command Line Tool for Windows Vista" & vbCrLf & _
                     "" & vbCrLf & _
                     "Purpose:" & vbCrLf & _
                     "--------" & vbCrLf & _
                     "To launch applications that prompt for elevation (i.e. Run as Administrator)" & vbCrLf & _
                     "from the command line, a script, or the Run box." & vbCrLf & _
                     "" & vbCrLf & _
                     "Usage:   " & vbCrLf & _
                     "" & vbCrLf & _
                     "    elevate application <arguments>" & vbCrLf & _
                     "" & vbCrLf & _
                     "" & vbCrLf & _
                     "Sample usage:" & vbCrLf & _
                     "" & vbCrLf & _
                     "    elevate notepad ""C:\Windows\win.ini""" & vbCrLf & _
                     "" & vbCrLf & _
                     "    elevate cmd /k cd ""C:\Program Files""" & vbCrLf & _
                     "" & vbCrLf & _
                     "    elevate powershell -NoExit -Command Set-Location 'C:\Windows'" & vbCrLf & _
                     "" & vbCrLf & _
                     "" & vbCrLf & _
                     "Usage with scripts: When using the elevate command with scripts such as" & vbCrLf & _
                     "Windows Script Host or Windows PowerShell scripts, you should specify" & vbCrLf & _
                     "the script host executable (i.e., wscript, cscript, powershell) as the " & vbCrLf & _
                     "application." & vbCrLf & _
                     "" & vbCrLf & _
                     "Sample usage with scripts:" & vbCrLf & _
                     "" & vbCrLf & _
                     "    elevate wscript ""C:\windows\system32\slmgr.vbs"" �dli" & vbCrLf & _
                     "" & vbCrLf & _
                     "    elevate powershell -NoExit -Command & 'C:\Temp\Test.ps1'" & vbCrLf & _
                     "" & vbCrLf & _
                     "" & vbCrLf & _
                     "The elevate command consists of the following files:" & vbCrLf & _
                     "" & vbCrLf & _
                     "    elevate.cmd" & vbCrLf & _
                     "    elevate.vbs" & vbCrLf
    
    End Sub
  • tools\chocolateyInstall.ps1 Show
    Remove-BinFile 'Sudo' '..\lib\Sudo.1.0\bin\sudo.cmd'
    Remove-BinFile 'Sudo' '..\lib\Sudo.1.0\bin\sudo.vbs'
    Remove-BinFile 'Sudo' '..\lib\Sudo.1.0.1\bin\sudo.cmd'
    Remove-BinFile 'Sudo' '..\lib\Sudo.1.0.1\bin\sudo.vbs'
    Generate-BinFile 'Sudo' '..\lib\Sudo\bin\sudo.cmd'
    

Virus Scan Results

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Dependencies

This package has no dependencies.

Maintainer(s)

Software Author(s)

  • Jan Hebnes

Tags

Release Notes

Thanks to Ferk <[email protected]> for providing the required fix for the package to function again in the new chocolatey

Version History

Version Downloads Last updated Status
Sudo 1.0.1 3849 Monday, September 8, 2014 approved
Sudo 1.0 1437 Wednesday, October 23, 2013 approved

Discussion for the Sudo Package

Ground rules:

  • This discussion is only about Sudo and the Sudo package. If you have feedback for Chocolatey, please contact the google group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or Sudo, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.

comments powered by Disqus