Jump to content

azler

Members
  • Posts

    8
  • Joined

  • Last visited

azler's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. No one got any information on this for me?
  2. Can someone explain to me why this is not working? _login() Func _login() global $ini,$fileLoc,$sUserName,$sDomain,$sPassword,$usrtemp, $ini global $login=4,$pass=4,$domain=4,$i,$sUserName, $sDomain, $sPassword global $arrlogin[$login] = ["usr1", "usr2", "usr3", "usr4"] global $arrpass[$pass] = ["pass1", "pass2", "pass3", "pass4"] global $arrdomain[$domain] = ["domain", @computername, @ComputerName, @ComputerName] $sUserName = "" $sPassword = "" $sDomain = "" For $i = 0 to $login - 1 $ExtCmd = @ComSpec & ' /c echo "Testing credentials for: "' & $arrlogin[$i] RunasWait($arrlogin[$i], $arrdomain[$i], $arrpass[$i], 2,$ExtCmd, @TempDir, @SW_HIDE) If @error Then MsgBox(0, "", $arrlogin[$i] & " " & $arrdomain[$i] & " " & $arrpass[$i] & " failed") ContinueLoop Else MsgBox(0, "", $arrlogin[$i] & " " & $arrdomain[$i] & " " & $arrpass[$i] & " worked") ContinueLoop endif Next if $sUserName == "" Then MsgBox(0, "", "No Login worked, Please Contect the IT help desk.") Exit EndIf EndFunc I have been using so i can package programs up to be installed by users without admin. 80% are on the domain and so the fist one works, the remaining 20% are not. I started using the '0 - Interactive logon with no profile' flag in the runaswait, but this did not pick up the any of the user accounts even though the middle two are on the computer. Then I tried the '2 - Network credentials only' flag and not apparently they all work.. even though the last one is a made up user name. Im sure you can see what I am trying to do here.. When on the domain it all works as it stops as the first user name and uses them credentials. Do you have to do something special if you are trying to use the runaswait on workgroup computers? Rob
  3. Would just like to say thanks for all the help 'Sleepydvdr' I have now managed to get it working. final code: ; Fill in the username and password appropriate for your system. Local $sUserName = "bob" Local $sPassword = "Password" Local $sDomain = @computername $fileLoc = @tempdir FileInstall("evolve\flash.msi", $fileLoc & '\flash.msi') FileInstall("evolve\evolve_install.msi", $fileLoc & '\evolve_install.msi') FileInstall("evolve\evolve.bat", $fileLoc & '\evolve.bat') RunAsWait($sUserName, $sDomain, $sPassword, 0, "msiexec /I " & '"' & $fileLoc & "\flash.msi" & '" /q"' & '"ALLUSERS=2"' ) RunAsWait($sUserName, $sDomain, $sPassword, 0, "msiexec /I " & '"' & $fileLoc & "\evolve_install.msi" & '" /q"' & '"ALLUSERS=2"' ) RunAsWait($sUserName, $sDomain, $sPassword, 0, @ComSpec & " /c " & $fileLoc & "\evolve.bat", @SystemDir) FileDelete($fileloc & "\flash.msi") FileDelete($fileloc & "\evolve_install.msi") FileDelete($fileloc & "\evolve.bat") MsgBox(0, "", "Evolve has now been installed") What I am going to work on now it producing some dynamic error messages and trying to make a progress bar to show the progress of the install. az
  4. I still get the same issue and it showing me the msi switches. When i started on it this morning I figured it would be nice and simple for it to run a program as an admin... how wrong I want. I cant see why this code is not working.. ; Fill in the username and password appropriate for your system. Local $sUserName = "usr" Local $sPassword = "pass" Local $sDomain = "domain" FileInstall("evolve_install.msi", @TempDir & '\evolve_install.msi") $pid = 'Msiexec.exe /I "' & @TempDir & '\evolve_install.msi" "/quiet"' RunAs($sUserName, $sDomain, $sPassword, 0, $pid) MsgBox(0, "", $pid)
  5. Ok i see thats a much better option and it now runs the program installer! Just need to add the silent switch which I cant seem to figure out: ; Fill in the username and password appropriate for your system. Local $sUserName = "usr" Local $sPassword = "pass" Local $sDomain = "domain" FileInstall("evolve_install.msi", @TempDir & "\evolve_install.msi") $pid = 'Msiexec.exe /I' & @Tempdir & '\evolve_install.msi "/quiet"' RunAs($sUserName, $sDomain, $sPassword, 0, $pid) but all that does it bring up the msi switches, am i putting it in the correct place?
  6. What I am trying to do is make an .exe file that will install another program with admin rights. I have all my files in a folder, the program installer and 2 .bat files that need to be run (one of the .bat files installs the program.) So then I am going to package all of this up in to a SFX , This will extract all the contents to the %temp% folder on the computer and run the autoit.exe file. I want the autoit.exe to 'runaswait' each of the .bat files to install the program.
  7. We have a program that needs to be installed on certain computers throughout the domain and we dont want to push it out with GPO as its too big, So i though why not make a AutoIT script to use the runas function and install it. The idea was solid and it works like a treat... I then though well why not make a self extracting exe file with winrar and get it to run the setup file when it is extracted? sleep(5000) If Not IsAdmin() Then RunAs('usr', "domain", 'pass',0,@SystemDir, @SW_HIDE) RunWait(@tempdir & "\evolve\run.bat","", @SW_HIDE) RunWait(@tempdir & "\evolve\evolve.bat","", @SW_HIDE) MsgBox(0,"","Evolve has been installed.") Else RunWait(@tempdir & "\evolve\run.bat","", @SW_HIDE) RunWait(@tempdir & "\evolve\evolve.bat","", @SW_HIDE) MsgBox(0,"","Evolve has been installed.") EndIf It appears to work fine, extracts the contacts to %temp% and launches the autoit.exe (above script) then instantly shows the msgbox.. If ii run the autoit.exe file directly from the %temp% it installs and works fine... Any ideas on this one? or a better way for me to do this? Az
  8. This is my first time at trying to use AutoIT or do any programing like this.. I recently made a simple PHP site where I can do fill in some forms and it stores it in a mysql DB simple stuff, My idea was could i make a set of forms using AutoIt, once they are filled in and you hit submit it send you to the PHP webpage that uses that information and inserts it in to the DB. I know this is possible and after endless searching I cant seem to find any examples for me to learn from. My code so far: #include <GUIConstants.au3> GUICreate("Computer Registration", 320, 240, @DesktopWidth/2-160, @DesktopHeight/2-150) GuiCtrlCreateLabel("Centre: ", 10, 5, 140, 20) $centre = GUICtrlCreateInput ( "", 160, 5, 150, 20) GuiCtrlCreateLabel("Make: ", 10, 35, 140, 20) $make = GUICtrlCreateInput ( "", 160, 35, 150, 20) GuiCtrlCreateLabel("Tag: ", 10, 65, 140, 20) $tag = GUICtrlCreateInput ( "", 160, 65, 150, 20) GuiCtrlCreateLabel("Serial: ", 10, 95, 140, 20) $serial = GUICtrlCreateInput ( "", 160, 95, 150, 20) $btn = GUICtrlCreateButton ("Begin!", 100, 200, 120, 20) ;============================================================================================== GUISetState() ; GUI MESSAGE LOOP GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd As you can see simple form. How do i now get it so when you click submit it send you to: website.php?center=$centre&make=$make&tag=$tag.. etc My other ideas that would make life easier would be to auto fill the $serial with the cmd "wmic bios get serialnumber" & is it possible to run autoit with custom switches? for example program.exe /laptop would send you to a different page with a different set of forms? I hope to get some positive feedback that will help me learn and expand my knowledge of this and hopefully get me progress me in to other coding languages. Az
×
×
  • Create New...