zotero/resource/hide.vbs
Dan Stillman a9ca6e0857 Support unmodified Xpdf binaries
Use stdout redirection scripts for pdfinfo and, on Windows, a script to
run pdftotext hidden, which together allow for all unmodified binaries
(including, probably, symlinked system ones, though I didn't test that).

On Windows, using a .vbs does cause a brief wait cursor. The stock
pdfinfo needs the redirection script anyway, so that's unavoidable, but
on the async branch I think we'll be able to switch to pdf.js for the
page count, at which point maybe I'll try to remember how I modified the
Windows binaries to be hidden and use a modified version of pdftotext to
avoid VBScript. (We use the stock pdftotext elsewhere already.)
2015-04-01 04:36:21 -04:00

24 lines
567 B
Text

Option Explicit
Dim WshShell, fso, exe, args, I
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
If WScript.Arguments.Count = 0 Then
WScript.Echo "Usage: hidden.vbs program.exe [args...]"
WScript.Quit 1
End If
exe = WScript.Arguments(0)
If Not(fso.FileExists(exe)) Then
WScript.Echo "Executable not found: " & exe
WScript.Quit 1
End If
args = ""
For I = 1 to WScript.Arguments.Count - 1
args = args & " " & chr(34) & WScript.Arguments(I) & chr(34)
Next
WshShell.Run exe & args, 0, true