run-as-admin | Golang example of using a manifest file | SSH Utils library

 by   mozey Go Version: Current License: No License

kandi X-RAY | run-as-admin Summary

kandi X-RAY | run-as-admin Summary

run-as-admin is a Go library typically used in Utilities, SSH Utils applications. run-as-admin has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

Golang example of using a manifest file to prompt "Run as administrator" on Windows
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              run-as-admin has a low active ecosystem.
              It has 57 star(s) with 16 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 2 have been closed. On average issues are closed in 222 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of run-as-admin is current.

            kandi-Quality Quality

              run-as-admin has 0 bugs and 0 code smells.

            kandi-Security Security

              run-as-admin has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              run-as-admin code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              run-as-admin does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              run-as-admin releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.
              It has 10 lines of code, 1 functions and 1 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed run-as-admin and discovered the below as its top functions. This is intended to give you an instant insight into run-as-admin implemented functionality, and help decide if they suit your requirements.
            • main is the main entry point
            Get all kandi verified functions for this library.

            run-as-admin Key Features

            No Key Features are available at this moment for run-as-admin.

            run-as-admin Examples and Code Snippets

            No Code Snippets are available at this moment for run-as-admin.

            Community Discussions

            QUESTION

            How to make application run as admin on user accounts?
            Asked 2022-Apr-07 at 16:44

            Is it possible to make a .NET application always an admin while being run on a user account without a UAC popup? I've spent some time searching for this capability but haven't found any satisfactory answers.

            For some background info, users are running a test application in a manufacturing environment where a dongle is plugged into a USB(to serial) port. Sometimes windows messes up the COM port and cycling the port can resolve the issue. We have discovered we can do this programmatically with admin privileges, but we do not want the users to be admins, and we also don't want the users to deal with a UAC popup or, god forbid, click "no" on the UAC popup to disable our capabilities and mess up the entire process.

            How do I force my .NET application to run as administrator? I have found this old thread but their solutions all require the user to be admin or the usual UAC popup.

            Is there something we can do to enable this capability or are we forever chained to the UAC prompt? We do own these machines and control the applications and users running on them.

            EDIT: We are cycling the COM port using this method:

            ...

            ANSWER

            Answered 2022-Apr-07 at 16:22

            You can't, not without at least an UAC prompt. This is totally unavoidable, otherwise Windows wouldn't have any security if it was possible - it MUST be totally impossible, not just "difficult", to bypass UAC.

            Some clues to solve anyway your problem:

            • You can force your application to always ask for elevation (i.e. make it to require administrative privileges) since the first step. Dangerous, but at least, you won't mess the whole software chain: it would be elevated from start.
            • You can ask for UAC only when it's really needed (for example, when launching a particular sub-process, or launching your own application in elevated mode while keeping context). Obviously, you'll ask again and again until the elevated subprocess is created: if user click on "No", then you try again to launch it. Annoying, but again, you won't mess up the whole process.
            • You can write a Windows service, that will run under administrative privileges, to perform the COM cycle task you need. Then, you can invoke this service from non-elevated user space, without requiring any elevation. I would recommend this solution.

            Source https://stackoverflow.com/questions/71782300

            QUESTION

            Powershell script running terminals indefinitely
            Asked 2022-Feb-07 at 14:50

            what I'm trying to do is setting up aliases to run Windows Terminal from file browser in the current directory, as admin or regular user. I'm not very familiar with powershell scripts and I'm trying to understand why my functions are called when the script is loaded instead of when the alias is called, which in turn runs terminals indefinitely..

            Here is the script I wrote in $Profile :

            ...

            ANSWER

            Answered 2022-Feb-07 at 14:50

            Quoting this excellent answer which explains really well what you're doing wrong:

            PowerShell aliases do not allow for arguments.
            They can only refer to a command name, which can be the name of a cmdlet or a function, or the name / path of a script or executable

            And from the official Docs:

            The Set-Alias cmdlet creates or changes an alias for a cmdlet or a command, such as a function, script, file, or other executable. An alias is an alternate name that refers to a cmdlet or command.

            This should help you understand what is going:

            Source https://stackoverflow.com/questions/71019204

            QUESTION

            Why is the wsl command not found by CMD on starting a batch file with a double click in FreeCommander?
            Asked 2021-Nov-29 at 17:21

            I want to use a batch script to start Docker in Windows Subsystem for Linux at login. It works when I run the batch file as administrator. So I followed this guide: Always Run Batch file as Administrator in Windows 10

            Then I placed the shortcut into the Startup folder. The script is started, but it exits always at the first line.

            Then I tried to run manually the batch file in FreeCommander. The batch script works when I run the script as administrator via right click context menu item. But there is output an error message when I run the batch script with a double click. The output error message is:

            The command "wsl" is either misspelled or could not be found.

            This is the batch script:

            ...

            ANSWER

            Answered 2021-Nov-29 at 17:21

            There should be read first the following Microsoft documentation pages:

            There are two system directories on 64-bit Windows with a processor with AMD64 architecture:

            1. %SystemRoot%\System32 with 64-bit applications used by 64-bit applications by default.
            2. %SystemRoot%\SysWOW64 with 32-bit applications used by 32-bit applications by default.

            The system environment variable PATH contains by Windows default %SystemRoot%\System32 as first folder path. If a 32-bit application starts cmd.exe to process a batch file, there is started 32-bit %SystemRoot%\SysWOW64\cmd.exe because of the file system redirector.

            cmd.exe is searching for files specified in a batch file just with file name without or with file extension and without path by using the local environment variables PATHEXT and PATH as explained in full details by What is the reason for "X is not recognized as an internal or external command, operable program or batch file"?

            wsl.exe belongs to the set of executables which on AMD64 Windows exists only as 64-bit version in %SystemRoot%\System32. There is no 32-bit version in %SystemRoot%\SysWOW64 searched by 32-bit cmd.exe on using %SystemRoot%\System32 in expanded form in local PATH because of file system redirector. For that reason the batch file as posted in the question does not work on being processed by 32-bit cmd.exe on Windows x64.

            The solution is taking WOW64 into account with additional code in the batch file:

            Source https://stackoverflow.com/questions/70112271

            QUESTION

            How to elevate account on start / install with standard user?
            Asked 2021-May-07 at 19:37

            Is it possible to enable /disable touchscreen trough hid (Human Interface Devices in "Control Panel\All Control Panel Items\Device Manager") with standard user right (without elevated-privileges / admin access-rights) ?
            I'm programing an application in C#. If I don't start my application trough "run as" on Visual Studio, security is blocking access.

            What are my alternatives with my current setup / limitation:

            • Standard user (basic right)
            • Admin account with password in a secure encrypted file.
            • The standard user cannot grant permission trough UAC because he don't have right.
            • Using this code to check if user have elevated/admin right: return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);

            Currently tested and not working:
            1. Process with startInfo.Verb = "runas"; Standard user can't accept UAC to run a process that require admin privilege / elevated. Elevating process privilege programmatically?

            2. App.manifest: Standard user can't accept UAC to run an app that require admin privilege / elevated. How do I force my .NET application to run as administrator?

            Potential alternatives ?

            1. ACL ???
            2. App.manifest: with an install.msi from my "IT team packager with Zenwork or SCCM" to deploy it on computers user ?
            3. Service that run as "local service" or "system" and an app to call methods of service with an install.msi from my "IT team packager with Zenwork or SCCM" to deploy it on computers user ?
            ...

            ANSWER

            Answered 2021-May-06 at 17:31

            If you don't want to prompt the UAC in the moment of the administrative operation (using runas), or on every program start (via manifest), you need to create a Service or a Scheduled Task once, at first program setup. A lot of programs use this technique such as Chrome for updates, which normally don't require elevated privileges but for few occasional operations.

            Choosing the service method means that you must implement an IPC mechanism for example via named pipe so the low privilege program can talk to the service and ask to execute the desired operation. Keep in mind that the service will always run in background and you shouldn't expose too much permissive operations otherwise other malicious programs could use your service to elevate themselves, or you'll need also an authentication method.

            For the scheduled task you could use the same executable with a command line argument like /disabletouch. You only need to manually trigger the task from the low privilege instance. There are the TaskScheduler COM interface (some open-source wrappers exists around it) and the schtasks tool that allow task creation and manual triggers. The task can be created for running as Administrator or SYSTEM account. As for the service allow only strict and harmless elevated operations to prevent misuse.

            Source https://stackoverflow.com/questions/66945543

            QUESTION

            Visual Studio 2019 always run as administrator from the task bar icon
            Asked 2021-Feb-25 at 19:32

            I want Visual Studio 2019 on Windows 10 to always run as administrator from the task bar icon. I need to run several solutions as administrator, so admin should be the default.

            Note: I want to run only 1 solution without admin privileges. For this 1 solution, using the recent solutions list from the taskbar icon works fine.

            Related:

            ...

            ANSWER

            Answered 2021-Feb-25 at 19:32

            I want Visual Studio 2019 on Windows 10 to always run as administrator from the task bar icon.


            Right-click the Visual Studio icon in your taskbar, or the shortcut on your desktop > right-click Visual Studio 2019 > Properties > Advanced... > Run as administrator > OK > Apply

            Now when you open Visual Studio from the taskbar, you should see ADMIN in upper-right corner!

            Source https://stackoverflow.com/questions/66375264

            QUESTION

            When elevating a powershell script to run as an admin, why does read-host accept keyboard input before the user is prompted?
            Asked 2021-Jan-03 at 02:46

            I'm running a PS 5.1 script that automatically elevates to run with admin privileges. The first part of the script runs a 3-minute check to make sure the environment is set up properly. The second part of the script asks for user input via read-host.

            ...

            ANSWER

            Answered 2021-Jan-03 at 02:40

            I don't think the issue is connected to whether you're running elevated or not.

            Assuming you're running in a console (terminal), you can clear the keyboard buffer as follows (adapted from this C# answer):

            Source https://stackoverflow.com/questions/65546049

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install run-as-admin

            Install rsrc tool for embedding binary resources in Go programs. Generates a .syso file with embedded resources.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/mozey/run-as-admin.git

          • CLI

            gh repo clone mozey/run-as-admin

          • sshUrl

            git@github.com:mozey/run-as-admin.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular SSH Utils Libraries

            openssl

            by openssl

            solid

            by solid

            Bastillion

            by bastillion-io

            sekey

            by sekey

            sshj

            by hierynomus

            Try Top Libraries by mozey

            aws-local

            by mozeyShell

            TWBootstrapJQValTooltip

            by mozeyJavaScript

            vim-timetracker

            by mozeyPython

            httprouter-util

            by mozeyGo