
signalcc
Members-
Posts
18 -
Joined
-
Last visited
Everything posted by signalcc
-
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
Yea I don't think that is going to matter at this point as UAC is the issue..... ugh , but again, thank you so much for the help. If I can't get past UAC this was all for naught... -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
I agree and I know it needs to be there. It is just getting very frustrating as now I don't believe there will be a way for me to get my job done without having 140 people come back to the home office. -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
So for giggles I decided to try and disable UAC from a reg key using the same theory as the rest of it. Providing the UN/PW and calling the REG file. I receive the same prompt, so the issue is that it's not passing the UN/PW through to the prompt as intended. But from what I am reading, it's not possible to do this. You can't bypass the UAC in any way shape or form. Really annoyed right now. -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
Sooooo, I popped another PC online that wasn't in use and signed in a regular user. I am unable to run the script as I receive the Windows Security box asking for the username and password. Here is the script that worked on a laptop that is also on the domain and was logged in as a standard user. It's the same script, I had to change the path as I didn't want it to be 5 folders deep. #RequireAdmin #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIError.au3> ; Change the username and password to the appropriate values for your system. Local $sUserName = "administrator" Local $sPassword = "**********" Local $sDirectory = "C:\users\" & @Username & "\Downloads\directsetup\directsetup" Local $sFiletoRun = "setup.bat" $iReturn = RunAsWait ($sUserName, @ComputerName, $sPassword, 0, $sDirectory & $sFiletoRun) If @error Then Local $sLastError = _WinAPI_GetLastErrorMessage() MsgBox($MB_SYSTEMMODAL + $MB_ICONERROR, "Error", "Batch file has not Run :" & @CRLF & @CRLF & $sLastError) Else MsgBox($MB_SYSTEMMODAL, "", "The return code from runaswait was: " & $iReturn) EndIf So I moved the Zip file to a share then to the downloads folder and extracted. This created the "\directsetup\directsetup\" path I am now using. When I double click on the .EXE I created in AutoIT it now pops up a security window asking for the username and password. It did not do this yesterday after I changed the code for the path as suggested by Nine. It opened the batch file, I selected 2 and it started the agent install properly. It went though the entire setup and finished successfully. Logged in as a terminal server test user I created some time ago I now receive the prompt in the attachment Logged in as the same user it worked for on the laptop yesterday and I receive the same prompt now. So I am confused as to how it worked yesterday but not today. Both the laptop and the desktop are on the domain, connected hard wired, and are receiving the same GPO's, both the users are standard domain users and neither have an "special" GPO's applied or belong to any groups outside of Domain User that would cause an issue. Obviously, the RUNASWAIT is not working properly as it is not putting the info in as needed. Am i just running on a pipe dream that this can work and bypass the security prompt? Please let me know your thoughts as I was so super excited yesterday seeing it work and now I feel quite deflated today. Thanks for all of your help!! -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
Ok, so I was informed late last night that many of these laptops/tablets have been out there for years and may have not received the Local Admin password update from GPO implemented about a year and a half ago. Is there any way to have the script try multiple usernames and passwords? Like have a box that pops up and says "Username or Password incorrect, there are 3 other entries we can attempt, Press ok to try again", and it goes to the next credential we have listed? I'm thinking this is really way outside what can be done, but you guys are super smart so I figured I would ask. Thanks so much for all of your help!!! -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
NINE!!! If you were a girl I would kiss you!!! You are correct I did not copy, I just added to mine and did it wrong I have now successfully run it on a non admin machine!!! I owe you big!!! Nine you are the "Person"!!!!! Thanks so much!!!! -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
Ok my brain is fried now. I'm headed home for the day. I will pick this up tomorrow Nine: thank you so much for all of your help. You have gotten me much further than I was and I appreciate it. Dana: Thank you as well for pointing out my issue in the code and helping me get the error portion straight. -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
Or maybe I don't I realized I was missing the "\" at the end of "directsetup" so I fixed that, but the same issue. Cannot find the file specified #RequireAdmin #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIError.au3> ; Change the username and password to the appropriate values for your system. Local $sUserName = "administrator" Local $sPassword = "***" Local $sDirectory = "C:\users\@UserName\Downloads\FortMyers\FortMyers\directsetup\" Local $sFiletoRun = "setup.bat" $iReturn = RunAsWait ($sUserName, @ComputerName, $sPassword, 0, $sDirectory & $sFiletoRun) If @error Then Local $sLastError = _WinAPI_GetLastErrorMessage() MsgBox($MB_SYSTEMMODAL + $MB_ICONERROR, "Error", "Batch file has not Run :" & @CRLF & @CRLF & $sLastError) Else MsgBox($MB_SYSTEMMODAL, "", "The return code from runaswait was: " & $iReturn) EndIf -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
Hang on I see the problem -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
Same problem System cannot find the file specified #RequireAdmin #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIError.au3> ; Change the username and password to the appropriate values for your system. Local $sUserName = "administrator" Local $sPassword = "****" Local $sDirectory = "C:\users\@UserName\Downloads\FortMyers\FortMyers\directsetup" Local $sFiletoRun = "setup.bat" $iReturn = RunAsWait ($sUserName, @ComputerName, $sPassword, 0, $sDirectory & $sFiletoRun) If @error Then Local $sLastError = _WinAPI_GetLastErrorMessage() MsgBox($MB_SYSTEMMODAL + $MB_ICONERROR, "Error", "Batch file has not Run :" & @CRLF & @CRLF & $sLastError) Else MsgBox($MB_SYSTEMMODAL, "", "The return code from runaswait was: " & $iReturn) EndIf -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
ok so I removed the "\" as suggest and it failed with "Cannot find the file specified" So I put it back on that "setup.bat" and removed it from the "directsetup" Same error So I put it back on the "directsetup" again and same issue "Cannot find the file specified" Local $sDirectory = "C:\users\%username%\Downloads\FortMyers\FortMyers\directsetup\" Local $sFiletoRun = "\setup.bat" Local $sDirectory = "C:\users\%username%\Downloads\FortMyers\FortMyers\directsetup\" Local $sFiletoRun = "setup.bat" Local $sDirectory = "C:\users\%username%\Downloads\FortMyers\FortMyers\directsetup" Local $sFiletoRun = "\setup.bat" All three ways give the same error now. Thank you so much, again, for all of your help -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
On the AU3 script or the setup.bat file? -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
Ok, that may remove the missing file error, but it is still not doing the run as admin part. It seems to run the Setup.bat as an admin, I guess I need to have the BAT file do a runas /administrator for it to run the MSI properly? -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
Ok so it works on my PC. Once I extract the ZIP file to a user PC that does not have admin rights and I run the script created about I get an error "Batch file has not run, the system cannot find the file specified" When I click ok on that it then runs the file, but then I get an alert that I do not have the proper permissions and I need to run the file as "Run as Administrator" So really, the script didn't do anything I was hoping for. Did I just go about this the wrong way? Here is the BAT file. Maybe that will help? We need the users to select Option 2. This will install the agent for us. Again, these PC's are all over the country and not connected locally tot he domain. @ECHO OFF cls @setlocal enableextensions @cd /d "%~dp0" :README ECHO. ECHO ****************************************************************************** ECHO. ECHO ManageEngine Desktop Central Remote Office Setup Wizard ECHO. ECHO This script will install the Desktop Central agent in this computer and in the computers specified in the computernames.txt.You should have logged in as an administrator to install the Agent. ECHO. ECHO ****************************************************************************** ECHO. ECHO. ECHO 1 - Install WAN Agent to client computers ECHO. ECHO 2 - Install WAN Agent in this computer ECHO. ECHO 3 - Exit ECHO. :GETINPUT set INPUT= set /P INPUT=Enter the option: %=% IF "%INPUT%" == "1" GOTO INSTALLWANAGENT IF "%INPUT%" == "2" GOTO INSTALLAGENT IF "%INPUT%" == "3" GOTO :EOF IF "%INPUT%" == "q" GOTO :EOF if "%INPUT%"=="" GOTO README GOTO INVALID :INSTALLAGENT start /wait msiexec /i DesktopCentralAgent.msi TRANSFORMS="DesktopCentralAgent.mst" ENABLESILENT=yes REBOOT=ReallySuppress INSTALLSOURCE=Manual /lv Agentinstalllog.txt IF "%ERRORLEVEL%" == "0" GOTO AGENTINSTALLSUCCESS IF "%ERRORLEVEL%" == "3010" GOTO AGENTINSTALLSUCCESS IF "%ERRORLEVEL%" == "1603" GOTO AGENTINSTALLFAIL_FATAL IF "%ERRORLEVEL%" == "1612" GOTO AGENTINSTALLFAIL_FATAL IF "%ERRORLEVEL%" == "1619" GOTO AGENTINSTALLFAIL_UNZIP GOTO AGENTINSTALLFAIL :INSTALLWANAGENT ECHO. ECHO Please make sure you have logged in as admin user in this computer ECHO. start /B /wait dcremagentinstaller.exe "dssetup" "dc" IF "%ERRORLEVEL%" == "9059" GOTO AGENTINSTALLFAIL_UNZIP GOTO SEELOGS :AGENTINSTALLFAIL_FATAL set ERROR=%ERRORLEVEL% ECHO. ECHO ----------------------------------------------------------------------------- Msg %username% /TIME:0 /V /W "Please run setup.bat in 'Run as administrator' mode." ECHO. ECHO DesktopCentral Agent installation failed. ErrorCode: %ERROR%" net helpmsg %ERROR% ECHO ----------------------------------------------------------------------------- GOTO ENDFILE :AGENTINSTALLFAIL_UNZIP set ERROR=%ERRORLEVEL% ECHO. ECHO ----------------------------------------------------------------------------- Msg %username% /TIME:0 /V /W "Please Un-Zip/ Extract the contents and try running setup.bat." ECHO DesktopCentral Agent installation failed. ErrorCode: %ERROR%" net helpmsg %ERROR% ECHO ----------------------------------------------------------------------------- GOTO ENDFILE :AGENTINSTALLSUCCESS ECHO. ECHO DesktopCentral Agent installed successfully. ECHO. GOTO ENDFILE :AGENTINSTALLFAIL ECHO. ECHO ----------------------------------------------------------------------------- ECHO DesktopCentral Agent installation failed. ErrorCode: %ERRORLEVEL% net helpmsg %ERRORLEVEL% ECHO ----------------------------------------------------------------------------- GOTO ENDFILE :INVALID Msg %username% /TIME:0 /V /W "Please enter the valid option." ECHO. GOTO GETINPUT :SEELOGS ECHO. ECHO See the logs.txt to verify the status of the installation of the WAN Agents. GOTO ENDFILE :ENDFILE ECHO. PAUSE -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
Holy god are you guys amazing!!!! I used #nine "\" and I had to add the same in front of the file name on the next line to get it to work. Now, I have admin rights, so i have to see if it is working on a non admin machine. I'll be in touch but thank you so much to both of you for all of your help!!! #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIError.au3> ; Change the username and password to the appropriate values for your system. Local $sUserName = "xxxxx" Local $sPassword = "xxxx" Local $sDirectory = "C:\users\%username%\Downloads\FortMyers\FortMyers\directsetup\" Local $sFiletoRun = "\setup.bat" $iReturn = RunAsWait ($sUserName, @ComputerName, $sPassword, 0, $sDirectory & $sFiletoRun) If @error Then Local $sLastError = _WinAPI_GetLastErrorMessage() MsgBox($MB_SYSTEMMODAL + $MB_ICONERROR, "Error", "Batch file has not Run :" & @CRLF & @CRLF & $sLastError) Else MsgBox($MB_SYSTEMMODAL, "", "The return code from runaswait was: " & $iReturn) EndIf -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
Ok so I spent a few on this, but a coder I am not. This is what I tried Local $iReturn = RunAsWait ( Func ; Change the username and password to the appropriate values for your system. Local $sUserName = "xxxx" Local $sPassword = "xxxx" Local $sDirectory = "C:\directsetup" Local $sFiletoRun = setup.bat RunAsWait($sUserName, @ComputerName, $sPassword, 0, $sDirectory & $sFiletoRun) EndFunc If @error Then Local $sLastError = _WinAPI_GetLastErrorMessage() MsgBox($MB_SYSTEMMODAL + $MB_ICONERROR, "Error", "Batch file has not Run :" & @CRLF & @CRLF & $sLastError) Else MsgBox($MB_SYSTEMMODAL, "", "The return code from runaswait was: " & $iReturn) EndIf Result is >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\directsetup\RunFirst.au3" "C:\directsetup\RunFirst.au3" (2) : ==> Badly formatted "Func" statement.: Func >Exit code: 1 Time: 0.2974 Thank you so much for trying to help me. i really appreciate it. -
Using AutoIT to call a BAT file as an admin - (Moved)
signalcc replied to signalcc's topic in AutoIt General Help and Support
Result is, >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\directsetup\NewRun.au3" C:\directsetup\NewRun.au3 (11) : ==> Badly formated variable or macro.: Local $iReturn = RunAsWait (....) Local $iReturn = RunAsWait (^ ERROR >Exit code: 1 Time: 0.2974 Maybe I put it in the wrong place? installAdmin() Func installAdmin() ; Change the username and password to the appropriate values for your system. Local $sUserName = "xxxxx" Local $sPassword = "xxx" Local $sDirectory = "C:\ASD4VM\Download\" Local $sFiletoRun = "Inst_with_Privileges.bat" RunAsWait($sUserName, @ComputerName, $sPassword, 0, $sDirectory & $sFiletoRun) Local $iReturn = RunAsWait (....) If @error Then Local $sLastError = _WinAPI_GetLastErrorMessage() MsgBox($MB_SYSTEMMODAL + $MB_ICONERROR, "Error", "Batch file has not Run :" & @CRLF & @CRLF & $sLastError) Else MsgBox($MB_SYSTEMMODAL, "", "The return code from runaswait was: " & $iReturn) EndIf EndFunc ;==>Example -
I have been doing nothing but reading and trying to figure this out. It appeared that AutoIT may be my answer, but I'm not sure as I have tried to work it and am not getting far. Here is my issue. I have about 140 Laptops/Tablets in the field. Many of them have not connected to the corporate network in quite some time. I have the install of our Management Software in a ZIP that is accessible from our corporate website. The issue I have is our users do not have Local Admin rights. In looking at the setup.bat file it requires it to be run as an admin. I need a way to get the BAT file to run itself as admin without a UN/PW prompt (I can provide that info for the script) or a separate BAT file that will set the Admin Elevation and then call the Setup file. Is there any way to do this? I have tried the following items installAdmin() Func installAdmin() ; Change the username and password to the appropriate values for your system. Local $sUserName = "xxxxx" Local $sPassword = "xxx" Local $sDirectory = "C:\ASD4VM\Download\" Local $sFiletoRun = "Inst_with_Privileges.bat" RunAsWait($sUserName, @ComputerName, $sPassword, 0, $sDirectory & $sFiletoRun) EndFunc ;==>Example This compiles and I run it with no result at all, it does nothing, but it also doesn't error. It just does nothing So then I tired the same script with a different folder path C:\directsetup\sertup.bat and the same thing, no result at all and no error in AutoIT Then i found someone say to remove the "" so I did that, still nothing. Then I found and tried this. It just errors on not finding WSSCRIPT Set WshShell=WScript.CreateObject("WScript.Shell") strCmd="\\server\application.exe" strUser="domain\admin" strPass="Password" set WshShell=CreateObject("WScript.Shell") WshShell.Run "runas.exe" & " /u:" & strUser & " " & strCmd WScript.Sleep 1000 WshShell.Sendkeys strPass & "~" Then I tried to uses this code I found. But all it does is error saying it can't parse the file. cd c:\directsetup\ strCmd=setup.bat strUser="bandi\BNIadmin" strPass="BNI@dmin" runaswait($strUser, $strDomain, $strPass, 0, $strCmd) I just need to be able to have an EXE that can run as is, then call the >BAT file running as admin to install the Monitoring Agent. Thanks so much for any assistance!!!