runas

Unable to supply password to runas from commandline

房东的猫 提交于 2019-11-30 09:54:17
问题 I am unable to supply password to runas from commandline I have tried the following cmd /C echo my_admin_password | runas /user:DOMAIN\my_admin_login c:\test.bat and echo my_admin_password | runas /user:DOMAIN\my_admin_login c:\test.bat And the error I get is Attempting to start c:\test.bat as user "DOMAIN\my_admin_login" ... RUNAS ERROR: Unable to run - c:\test.bat 1326: Logon failure: unknown user name or bad password. How do I fix this? 回答1: Take a look at this link: runas utility It's a

start batch file from within vb.net as admin

旧时模样 提交于 2019-11-29 15:18:45
In my application, I need to run a batch file as admin for it to function. I'm using this so far but I cant remember how to use the runas feature which allows it to run with admin rights. process.start("filelocation.bat") Any help would be apreciated. Try Dim procInfo As New ProcessStartInfo() procInfo.UseShellExecute = True procInfo.FileName = (FileLocation) procInfo.WorkingDirectory = "" procInfo.Verb = "runas" Process.Start(procInfo) Catch ex As Exception MessageBox.Show(ex.Message.ToString()) End Try You could try with this code: Dim proc as ProcessStartInfo = new ProcessStartInfo() proc

Run child process non-elevated from an elevated/As Admin process

半世苍凉 提交于 2019-11-29 12:50:14
My application has a built-in self update system via another app called "updater.exe" which is in the same folder with the main application to update. It downloads the newest version, terminates the old one (if it's running) and then overwrites it. The problem is, to do that the updater.exe must be run with the Administrator privileges in order to have access to C:\Program Files\MyApp So far so good, the main app runs the updater.exe with Admin privileges (using UAC) but then the problem appears: After update is completed, I want the new installed version to start automatically. Guess what? Of

Runas in another Windows terminal session

亡梦爱人 提交于 2019-11-29 02:23:46
For simplicity, let's say the user Administrator is logged in in terminal session 2 . Another user Boda is logged in terminal session 3 . Is it possible to runas a program in session 3 from session 2 ? For simplicity, let's say I want to start calc.exe in session 3 (in Boda's session). How do I do that? Can it be done with runas ? Like Harry Johnston suggested in a comment you can do this using the psexec tool available on TechNet . I've tried it using a Windows 2008 Server running Terminal Services and managed to start various applications in another users session (although not calc.exe - it

Batch Script to Run as Administrator

天涯浪子 提交于 2019-11-28 17:57:52
I'm writing a client/server checking program but it needs to run as Administrator. I want this to run silently on my network and users, and I don't want the "Run as" Administrator" prompt. Is there any beginning code that I can place into the batch file to make it auto-run as Administrator? zenin Solutions that did not work No: The - create a shortcut [ -> Compatibility -> "run this program as an administrator" ] solution does not work. This option is greyed out in Windows 7. Even with UAC disabled No: The runas /env /user:domain\Administrator <program.exe/command you want to execute> is also

start batch file from within vb.net as admin

风格不统一 提交于 2019-11-28 08:46:59
问题 In my application, I need to run a batch file as admin for it to function. I'm using this so far but I cant remember how to use the runas feature which allows it to run with admin rights. process.start("filelocation.bat") Any help would be apreciated. 回答1: Try Dim procInfo As New ProcessStartInfo() procInfo.UseShellExecute = True procInfo.FileName = (FileLocation) procInfo.WorkingDirectory = "" procInfo.Verb = "runas" Process.Start(procInfo) Catch ex As Exception MessageBox.Show(ex.Message

Run child process non-elevated from an elevated/As Admin process

杀马特。学长 韩版系。学妹 提交于 2019-11-28 06:10:55
问题 My application has a built-in self update system via another app called "updater.exe" which is in the same folder with the main application to update. It downloads the newest version, terminates the old one (if it's running) and then overwrites it. The problem is, to do that the updater.exe must be run with the Administrator privileges in order to have access to C:\Program Files\MyApp So far so good, the main app runs the updater.exe with Admin privileges (using UAC) but then the problem

mkdir in batch file as admin

前提是你 提交于 2019-11-28 01:46:31
I'm trying to write a batch file that creates a new directory in %programfiles% . It needs to be run as admin. I've tried: runas /user:admin-pc\admin "mkdir C:\Program Files\MyDir" runas /user:admin-pc\admin "mkdir \"C:\Program Files\MyDir\"" runas /user:admin-pc\admin "cmd /c mkdir \"C:\Program Files\MyDir\"" runas /user:admin-pc\admin "cmd /c mkdir %programfiles%\MyDir" runas /user:admin-pc\admin "cmd /c mkdir \"C:/Program Files/MyDir\"" runas /user:admin-pc\admin "cmd /c mkdir C:\Program^ Files\MyDir" What's the right way to do this? The question turned out to be IExpress specific. You cam

Python subprocess.Popen as different user on Windows

怎甘沉沦 提交于 2019-11-28 00:14:50
What is the best manner of launching a subprocess as a different user in Python on Windows? Preferably XP and up, but if it works only on Vista and 7, I can live with that too. I am not sure if you can do this with the standard python libraries. However, the pywin32 package has a win32process.CreateProcessAsUser function which may be what you need. Another option is to popen not the desired process but runas ... command. Note that the Run As service should be enabled and running. roberto I ended up augmenting subprocess: #!/usr/bin/env python # -*- coding: utf-8 -*- import subprocess import

How to complete the RUNAS command in one line [closed]

蓝咒 提交于 2019-11-27 23:21:39
问题 This Stack Overflow question suggests a command which looks as if it should work, but it doesn't (that answer is deleted now, though): Single line command for Run as a different user on Window 7 that contains a password also The command would be: echo PaSsWoRd | runas /user:Administrator cmd However it says: unknown user name or bad password. The details are definitely correct though. For example, if I was to run: runas /user:Administrator ...and on the next line, if I typed in PaSsWoRd , it