4 posts in this topic
Windows 10 RunAs script problem
I have a problem, I cant run script as administrator in Windows 10:
Global $sUserName = "administrator"
Global $sPassword = "pass"
Global $sDomain = "domain"
RunAsWait($sUserName, $sDomain, $sPassword, 2, "main.exe", "", @TempDir)
If I run "run.exe" it dont work...
If I change main.exe to this:
and it runs and shows administrator in message box... but it cant elevate main.exe with RegWrite() command...
I tried using #RequireAdmin in first line of main.exe, but it not worked... UAC is set to "do not notify"
This method of elevation worked on Windows 7 and Windows XP...
runas access is denied
for some reason when I run this command with run as in autoit it returns access is denied. but when I run the same thing in an elevated command shell it works fine. Im not sure where I am messing up.
global $rtech,$rcred, $IP $rtech = inputbox("","username") $rcred = InputBox("","password") $ip = inputbox("","enter IP") $pid = Runas ($rtech,"mhs", $rcred, 2 ,@ComSpec & ' /c reg query \\' & $ip & '"\hklm\software\microsoft\windows\currentversion\group policy\state\machine"|findstr /i "disting"', @SystemDir, @SW_hide, $STDERR_CHILD + $STDOUT_CHILD) Local $line While 1 $line &= StdoutRead($pid) If @error Then ExitLoop WEnd While 1 $line &= StderrRead($pid) If @error Then ExitLoop WEnd MsgBox(0, "", $line)
Run() executes on some computers but not others
I've got a script setup to drop a program into a temp folder and then run it from there, but I have mixed results, the Run() command will work on some computers but not others. The file will be placed into the temp folder in all cases. Running AutoIT 22.214.171.124. The computers are all either Win 7 or 8.1, x64 (exe is compiled to x64 too), UAC is off, all have local admin rights - if I've missed something ask and I'll update the details.
If Not FileExists (@TempDir & "\HCTB") Then DirCreate(@TempDir & "\HCTB") FileInstall("G:\IT\Downloads\TB\12.0.45471\Host\TB_Setup-sif7r8pgcq.exe", @TempDir & "\HCTB\TB_Setup-sif7r8pgcq.exe", 1) Local $iPID = Run(@TempDir & "\HCTB\TB_Setup-sif7r8pgcq.exe", "") Any suggestions?
How to add recoder into HOSTS with RunAs in Win7
i want add one recorder into HOSTS file file with following script in windows 7, but always failed, does anyone help me to correct it ?
Local $sUserName = "Administrator"
Local $sPassword = "abcd1234"
RunAs($sUserName,@computername,$sPassword,0,"attrib -s -h -r C:\Windows\System32\drivers\etc\hosts")
RunAs($sUserName,@computername,$sPassword,0,"echo xxx.xxx.xxx.xxx www.google.com" & @CRLF)
RunAs($sUserName,@computername,$sPassword,0,"attrib +s +h +r C:\Windows\System32\drivers\etc\hosts")
Add printer with RunAs
Hi, i'm trying to add a printer with RunAs credentials in a domain environment.
I'm loged on as a local user, and in the startupscript it says:
runas("administrator","domain","******",1,runwait("rundll32 printui.dll,PrintUIEntry /in /n" & "\\printserver\printername" & " /q")) It will not connect to the domain, and therefor will not install printer.