VB.net 2015 Prevent a second CMD instance to show up -
shell("cmd.exe", appwinstyle.minimizedfocus) thread.sleep(50) my.computer.keyboard.sendkeys("cd c:\users\administrator\desktop\captcharuc", true) my.computer.keyboard.sendkeys("{enter}", true) thread.sleep(50) my.computer.keyboard.sendkeys("tesseract.exe imagen.jpg leerca -psm 7", true) my.computer.keyboard.sendkeys("{enter}", true) thread.sleep(50) my.computer.keyboard.sendkeys("exit", true) my.computer.keyboard.sendkeys("{enter}", true)
im streaming commands cmd instance, works fine when execute tesseract.exe cmd instance opens execute such program.
this regular behavior of tesseract if steps manually, second cmd instance show execute tesseract commands.
this part of windows app im developing , dont want second instance show up.
i have tried with
const strcmdtext string = "/c cd c:\users\administrator\desktop\captcharuc\&tesseract.exe imagen.jpg leerca -psm 7" dim startinfo new processstartinfo("cmd.exe") startinfo.windowstyle = processwindowstyle.minimized startinfo.windowstyle = processwindowstyle.hidden startinfo.createnowindow = true startinfo.useshellexecute = false startinfo.arguments = strcmdtext process.start(startinfo)
and
shell("cmd /c """ & "cd c:\users\administrator\desktop\captcharuc\" & "&tesseract.exe imagen.jpg leerca -psm 7" & """", appwinstyle.hide, true)
in 3 cases main instance either run minimized or hidden intended second instance bring tesseract instance.
would appreciate if here ran out of ideas on how prevent such event happening.
thanks in advance
after night sleep came solution problem, did create .bat file
@echo off set _sourcepath=c:\users\administrator\desktop\captcharuc\*.jpg set _outputpath=c:\users\administrator\desktop\captcharuc\ set _tesseract="c:\program files (x86)\tesseract-ocr\tesseract.exe" %%a in (%_sourcepath%) echo converting %%a...&%_tesseract% %%a %_outputpath%%leerca set "_sourcepath=" set "_outputpath=" set "_tesseract="
and called with
shell("c:\users\administrator\desktop\captcharuc\tese.bat", appwinstyle.hide)
and thats it.. mods feel free mark thread solved. thanks
Comments
Post a Comment