I have this line in powershell
Code: Select all
tesseract.exe Sample.png Output.txt -l eng
Code: Select all
Sub Test()
Dim retval, pscmd
pscmd = "PowerShell -ExecutionPolicy Bypass -Command ""tesseract.exe " & ThisWorkbook.Path & ""\Sample.png\"" & "" "" & ThisWorkbook.Path & ""\Output.txt\"" -l eng"
retval = Shell(pscmd, vbNormalFocus)
Debug.Print pscmd
End Sub
Code: Select all
Sub Test()
Dim retval, pscmd$, cdcmd$
cdcmd = "PowerShell.exe -noexit -ExecutionPolicy Bypass -Command ""cd C:\Users\Future\desktop"""
pscmd = "PowerShell.exe -noexit -ExecutionPolicy Bypass -Command ""tesseract.exe Sample.png Output.txt -l eng"""
retval = Shell(cdcmd, vbNormalFocus)
retval = Shell(pscmd, vbNormalFocus)
Debug.Print pscmd
End Sub
The line of pscmd appears iun red. I tried to play around and fix it but I couldn't