runas

How can I make the installer Run as admin

本小妞迷上赌 提交于 2019-11-27 20:35:00
My application has an installer built in installshield. But for proper working of installation process in vista Win 7 etc. the installer should be run as administrator. (Even though the user has admin previlege he should select the 'Run as Administrator' option in the menu on rightclicking the installer exe) How can I make my installer to prompt that it should be always run as administrator. Thanks in advance... You need to set the execution level to "Require Administrator" from the project options. This option will be stored in the manifest file included in your setup package and it will make

Running PowerShell as another user, and launching a script

戏子无情 提交于 2019-11-27 20:26:11
I won't get into all the details of why I need this, but users must be able to launch PowerShell as a service account and when PowerShell loads it needs to run a script. I already can launch PowerShell with the stored credentials (stored as a secure string), but for the life of me I cannot get the script (located in $args) to run. I have tried a variety of things, and below is where I am currently. Any help would be greatly appreciated. $user = "domain\service.account" $pwd1 = "big long huge string of characters" $pwd = ($pwd1 | ConvertTo-SecureString) $Credential = New-Object System

SQL Server Management Studio 2008 Runas user on different domain over VPN

扶醉桌前 提交于 2019-11-27 17:52:32
I am currently trying to run SQL Server Management Studio 2008 as a user who is on a different domain. I noticed in other threads that running the following command from a batch script will do this however it doesn't seem to work for me. runas /netonly /user:DOMAIN\USER "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe" I am asked for my password, the Login screen appears however the Windows Authentication username and password are still incorrectly the currently logged in impersonated user on the local Domain. Attempting to connect to the database on the other

How do I 'run as' 'Network Service'?

假如想象 提交于 2019-11-27 17:09:31
I am trying to run a process as another account. I have the command: runas "/user:WIN-CLR8YU96CL5\network service" "abwsx1.exe" but then this asks for the password. However there is no password set for the network service. Is what I am trying to do possible? Use PsExec.exe from SysInternals, running from an elevated command prompt. e.g. this will open a new command prompt running as NETWORK SERVICE: psexec -i -u "nt authority\network service" cmd.exe this will run it as LOCAL SYSTEM: psexec -i -s cmd.exe You can verify these by running whoami from the cmd prompt. See also: http://forum

Automatically respond to runas from batch file

萝らか妹 提交于 2019-11-27 14:31:58
I'm trying to get a batch file to automatically enter the password into the "runas" program, but I can't get it to work. Here's my batch file so far: echo password | runas /user:testuser c:/path/to/my/program.exe However, I get an error saying "unknown user name or bad password". I have also tried: runas /user:testuser c:/path/to/my/program.exe < c:/path/to/file/containing/password.txt This comes back with the same error. Does anyone know a way to do this? What I'm trying to do eventually is get the batch file to read a username and password from a config file, and then start "program.exe" as

Using python to open cmd and automatically enter a password

Deadly 提交于 2019-11-27 09:49:00
I've managed to get the cmd being opened by python. However, using runas administrator comes with a password check before cmd.exe is executed. I'm using this to open cmd... import subprocess subprocess.call(["runas", "/user:Administrator", "cmd.exe"]) I'm looking for a way to automatically enter the password into the runas.exe prompt which opens when i run the code. Say if i were to create var = "test" and add it after import subprocess how would i make it so that this variable is passed to and seen as an input to the runas.exe? The solution would require only python modules which are in

How do you request administrator permissions using NSIS?

Deadly 提交于 2019-11-27 08:27:04
I am quite new with NSIS. I am trying to request administrator permissions in order to run the installer, as it messes around a bit with registries. My problem with "RequestExecutionLevel" and "MULTIUSER_EXECUTIONLEVEL" is that they both absolutely block any non-Admin user from opening the installer, even when selecting "Run as Administrator" in the context menu. I have tried using the RunAs DLL, but I have not found a single thread as to what to put in the $command variable passed to "RunAsW" function. Here is my (pretty hacked-up) code: StrCpy $0 0 StrCpy $1 "" System::Call 'RunAs:

How to build RUNAS /NETONLY functionality into a (C#/.NET/WinForms) program?

北慕城南 提交于 2019-11-27 07:27:46
Our workstations are not members of the domain our SQL Server is on. (They're not actually on a domain at all - don't ask). When we use SSMS or anything to connect to the SQL Server, we use RUNAS /NETONLY with DOMAIN\user. Then we type in the password and it launches the program. (RUNAS /NETONLY does not allow you to include the password in the batch file). So I've got a .NET WinForms app which needs a SQL connection, and the users have to launch it by running a batch file which has the RUNAS /NETONLY command-line and then it launches the EXE. If the user accidentally launches the EXE directly

How to set “Run this program as an administrator” programmatically

雨燕双飞 提交于 2019-11-27 06:41:26
I'm having a problem with good ol' bdeadmin.exe in Vista. First, let's get the predictable responses out of the way: "You should not require your application to be elevated." This one does. C'est la vie. "You need to embed a manifest file." It is already compiled, it is many years old, the company that created it has no intention of doing it again, and it is installed from a Merge Module (MSM file). "BDE is obsolete, you should be using dbExpress" One and a half million lines of code. 'Nuff said. "Drop a manifest file next to the EXE." Tried that, did nothing. As a test, that same manifest

How can I make the installer Run as admin

自古美人都是妖i 提交于 2019-11-26 22:57:26
问题 My application has an installer built in installshield. But for proper working of installation process in vista Win 7 etc. the installer should be run as administrator. (Even though the user has admin previlege he should select the 'Run as Administrator' option in the menu on rightclicking the installer exe) How can I make my installer to prompt that it should be always run as administrator. Thanks in advance... 回答1: You need to set the execution level to "Require Administrator" from the