Jump to content

TyCoutch

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by TyCoutch

  1. Steven, here is the script we use and when it works it works great. For the warning message that pops up after you select scan, we set for the script to sent Enter. Enter will select yes on that warning and continue the script. ; AutoIt v3.3.14.5 ; https://www.autoitscript.com #include <MsgBoxConstants.au3> ; Path to QuickBooks Database Server Manager Global Const $qbDSM = "C:\Program Files (x86)\Common Files\Intuit\QuickBooks\QBServerUtilityMgr.exe" ; Title of window Global Const $title = "QuickBooks Database Server Manager"; Main() ; Main Function Func Main()     ; check if program already running     If WinExists("[TITLE:"&$title&"]") Then         ;program running close it and wait 5 seconds for it close         WinClose("[TITLE:"&$title&"]")         WinWaitClose("[TITLE:"&$title&"]",5)     EndIf     Launch() EndFunc ; launch the QuickBooks Database Server Manager Func Launch()     ; Check if the Program File Exists     Local $exist = FileExists($qbDSM)     If $exist Then ; if it does exist         ; launch the program         Local $iPID = Run($qbDSM)         ; wait upto 5 seconds for the window to appear         WinWait("[TITLE:"&$title&"]","",5)         ; wait 10 seconds incase it takes a while to launch         Sleep (10000)         ; Select the window to execute the remianing commands         WinActivate($title)         ; send keys to start Scan         Scan()     Else ; if program not found, message box saying not found         MsgBox($MB_SYSTEMMODAL,"Error","Program " & $qbDSM & " not found")     EndIf EndFunc Func Scan()     ; send the tab key to move to [Start Scan] button     Send("{TAB}")     ; send the enter key to start the scan     Send("{ENTER}")     ; send the enter key to close the warning message     Send("{ENTER}")     ; wait 15 seconds for the scan to finish     Sleep (15000)     ; Lock the screen for security reasons     ShellExecute("rundll32.exe", "user32.dll,LockWorkStation") EndFunc
  2. Hi, We have created a script on our 2019 Server. It works perfectly everytime I run it. I moved the file to a 2008 R2 server and nothing happens at all. I launch the .au3 file and nothing happens. I then moved the file onto a 2016 Server and was able to manually run the file once and then it wouldn't run again. I created a task in task schedular to launch Autoit3.exe and grab the .au3 file upon logon. This works everytime but I still cannot manually run this. Below is our script. ; AutoIt v3.3.14.5 ; https://www.autoitscript.com #include <MsgBoxConstants.au3> ; Path to QuickBooks Database Server Manager Global Const $qbDSM = "C:\Program Files (x86)\Common Files\Intuit\QuickBooks\QBServerUtilityMgr.exe" ; Title of window Global Const $title = "QuickBooks Database Server Manager"; Main() ; Main Function Func Main()     ; check if program already running     If WinExists("[TITLE:"&$title&"]") Then         ;program running close it and wait 5 seconds for it close         WinClose("[TITLE:"&$title&"]")         WinWaitClose("[TITLE:"&$title&"]",5)     EndIf     Launch() EndFunc ; launch the QuickBooks Database Server Manager Func Launch()     ; Check if the Program File Exists     Local $exist = FileExists($qbDSM)     If $exist Then ; if it does exist         ; launch the program         Local $iPID = Run($qbDSM)         ; wait upto 5 seconds for the window to appear         WinWait("[TITLE:"&$title&"]","",5)         ; wait 10 seconds incase it takes a while to launch         Sleep (10000)         ; Select the window to execute the remianing commands         WinActivate($title)         ; send keys to start Scan         Scan()     Else ; if program not found, message box saying not found         MsgBox($MB_SYSTEMMODAL,"Error","Program " & $qbDSM & " not found")     EndIf EndFunc Func Scan()     ; send the tab key to move to [Start Scan] button     Send("{TAB}")     ; send the enter key to start the scan     Send("{ENTER}")     ; send the enter key to close the warning message     Send("{ENTER}")     ; wait 15 seconds for the scan to finish     Sleep (15000)     ; Lock the screen for security reasons     ShellExecute("rundll32.exe", "user32.dll,LockWorkStation") EndFunc
  3. I have this same issue. I built everything on a 2019 server, got it working then copied the file to a 2008 R2 server, installed AutoIT and it would not work at all. Same exact issue, iPID=0 and nothing would happen. Task Manager would show the .exe running as well. I then took it to another server that had 2016. Manually running the .au3 file only worked once then would not run anymore. I created a task in task scheduler to run the Autoit3.exe and said for it to grab the .au3 file upon logon. Once I restarted the server the task ran successfully and launched what I wanted the scirpt to do but I cannot manually run the .au3 file still. The logon task has continued to work without any issues.
×
×
  • Create New...