[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Need to have a program that runs under Limited User but allows launching of Command prompt, etc. w/ Admin rights

Posted on 2006-11-23
Medium Priority
Last Modified: 2010-04-23
Here's our dilemma.  We have an extremely locked down environment on remote machines (no command prompt, control panel, etc).  Rather than having to logoff/on each time, we need quick access to the command prompt.

We want a program that will a launch, prompt for a "daily passcode" (IE today's date * 5, or whatever).  Then, you click a button and it launches the command prompt.  Since the command prompt is BLOCKED by Group Policy, it needs to launch CMD.EXE w/ RUN AS but shouldn't prompt for the user.

Something like this -- > http://launch-admin.sourceforge.net/

The difference is, that we want it to be custom tailoried to our environment so we can add our "daily passcode" protection.

I'm not a programmer, but we have one here in our office that would understand VB .NET if I had the code.  We can also do in VB6 if it's easy enough -- But that may not be the way to go.

Question by:jgantes
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 16

Expert Comment

ID: 18001886
Hi jgantes,

if you put the following into a VB .NET project it will (when run) prompt you for the users's password then start cmd.exe.  There isn't a "/password" option for runas, so I don't think you can supply this easily.  If you still need the "daily passcode" as well as the user you could just craft a popup windows form that prompts for the passcode.  Let me know if you need a hand with this as well.

        Dim x As New System.Diagnostics.Process
        x.StartInfo.FileName = "runas.exe"
        x.StartInfo.Arguments = "/user:DomainName\AdministratorAccountName cmd.exe"


Author Comment

ID: 18004501
Hi Hilwaaa,

I'm thinking the daily passcode part should be prett straightforward.  I guess we're out of luck then on the "runas" situation.  Stinks that there isn't a way to automate the password portion --

I know there is a source forge project that provides a full-fledged app. that can launch items as another user, but it's not quite what we need.

What about user impersonation in VB?  Any ideas on that?


Author Comment

ID: 18006210
I found a third party product (that I was originally avoiding) that will do everything I need from a CLI.


I'll still need a program that opens up, prompts for a "daily passcode" and if correct, lets the person enter and click a button that launchs the my third party app w/ command line switches!
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 16

Accepted Solution

Hillwaaa earned 900 total points
ID: 18006570
Hi jgantes - try this (was coded in VB .NET 2003):

Public Class Form1

    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        'This call is required by the Windows Form Designer.

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
            End If
        End If
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Label1 As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.TextBox1 = New System.Windows.Forms.TextBox
        Me.Button1 = New System.Windows.Forms.Button
        Me.Label1 = New System.Windows.Forms.Label
        Me.TextBox1.Location = New System.Drawing.Point(136, 40)
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.TabIndex = 3
        Me.TextBox1.Text = ""
        Me.Button1.Location = New System.Drawing.Point(160, 136)
        Me.Button1.Name = "Button1"
        Me.Button1.TabIndex = 4
        Me.Button1.Text = "OK"
        Me.Label1.Location = New System.Drawing.Point(8, 40)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(112, 23)
        Me.Label1.TabIndex = 5
        Me.Label1.Text = "Enter daily postcode:"
        Me.AcceptButton = Me.Button1
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(256, 174)
        Me.Name = "Form1"
        Me.Text = "Open Command Shell"

    End Sub

#End Region

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If (Me.TextBox1.Text.Equals(CStr(Now.Day * 5))) Then

            Dim x As New System.Diagnostics.Process
            x.StartInfo.FileName = "runas.exe"
            x.StartInfo.Arguments = "/user:Domain\UserAccount cmd.exe"
            MessageBox.Show("Invalid Passcode")
        End If

    End Sub
End Class
LVL 16

Expert Comment

ID: 18006575
You'll have to update the name of the application (and any arguments) - as well as change the daily passcode function if you don't want the day*5 formula.


Author Comment

ID: 18008826
Thanks a ton Hilwaa!

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question