Friday 21 October 2011

sudo for Windows 7

Whenever I wanted to start any Service on a Windows 7 Box I had to either start the Services Management tool or a command terminal as Administrator. The runas command in Windows is not capable of running Script commands like ‘net start …’ and unfortunately there is no command like su or sudo in Windows.

Well, there is no built-in command su or sudo. There is a sudo project on SF. But it’s a .NET application where you will have to install and configure it. It is a great tool but for my taste it is to big. I was looking for a tool that we can download and run as is. No installation and no further requirements than Windows (Vista or 7) itself.

All I have found was not really what I was looking for. Either I had to install it or it required some quirky runtime library or it just didn’t feel the way I wanted it to. So I wrote my own. It isn’t perfect or in any way complete (yet) but it works and it is simple.

It’s written in C and uses WinAPI calls only. There is no requirement except the C Runtime library which is installed anyway. It does not provide running a process under a different user, it just lets you elevate the security level of the process to run. If the user has the privileges to run a program as admin he’ll be able by starting the program with the command ‘sudo …’.

At the moment you can download the tool here. It is hosted at DataFileHost.com.

I’ll release the software and the source code under an open source license in the near future. I just have not decided yet. Therefore I released only the binary as freeware for now.

THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

No comments: