Bamfkin Posted November 25, 2016 Posted November 25, 2016 I am on Windows 10. I've been trying to test using tesseract in AutoIt but it never runs tesseract as administrator. I've run the script as Administrator, I've tried RunAs using system and administrator accounts. The reason why I am saying this is the issue is because tesseract does not create an output file unless I run it from an admin command prompt. Running it from a non-admin command prompt produces the same situation I'm seeing from AutoIt - everything runs successfully except creating the output file. This is the shell execute code I'm running. #include-once #include <Tesseract.au3> #include <Date.au3> $windowTitle = "*new 1 - Notepad++" $scale = 2 $left_indent =53 $top_indent =98 $right_indent =(880-224) $bottom_indent =(560-118) $capture_filename = $tesseract_temp_path & StringReplace(_NowDate(), "/", "_") & "_" & StringReplace(StringReplace(_NowTime(), ":", "_"), " ", "_") & ".tif" _FileCreate($capture_filename) $output_filename = StringLeft($capture_filename, StringLen($capture_filename) - 4) CaptureToTIFF($windowTitle, "", "", $capture_filename, $scale, $left_indent, $top_indent, $right_indent, $bottom_indent) ShellExecuteWait(@ProgramFilesDir & "\Tesseract-OCR\tesseract.exe", $capture_filename & " " & $output_filename) Im piggy backing off of the tesseract.au3 right now but all of this was done because it wasn't working (after I updated to correct file paths) Anyone had this issue and/or know of a way to work around this?
Bamfkin Posted November 25, 2016 Author Posted November 25, 2016 Either I'm blind or there is no edit button... but I'm open to other suggestions if someone doesn't believe it to be a permissions issue.
spudw2k Posted November 25, 2016 Posted November 25, 2016 Have you seen and tried the #RequireAdmin keyword? Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
Bamfkin Posted November 25, 2016 Author Posted November 25, 2016 I had not. Just tried it and nothing new. Creates a .tif but no output file from tesseract. I printed the ShellExecuteWait as ConsoleWrite(@ProgramFilesDir & "\Tesseract-OCR\tesseract.exe " & $capture_filename & " " & $output_filename & @CRLF) Then copy/paste that into a command prompt.. put quotes around all 3 paths and it creates the output file. Is something wrong with how Im using ShellExecuteWait? Do I need to somehow inherently put quotations marks within it? It would be great if I could get the command prompt to pause when it pops up from ShellExecuteWait so I could see what is being executed... anyone know how to make that happen?
Bamfkin Posted November 25, 2016 Author Posted November 25, 2016 So, after that post I moved my tesseract install to directly into the C: drive and where I was saving my files directly to the C: drive. It works now. So either it's a permission issue with Program Files x86 or ShellExecute needs me to put quotation marks into the string (which Im not sure how to do in AutoIt; thats why I just moved everything).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now