Document Scanning Using Vbscript

I have a scanner script that I got from here:

http://beaukey.blogspot.com/2015/09/document-scan-with-vbsscript-and-wia.html

OPTION EXPLICIT

'--- dim objects...
dim wsh, fso, objWIAdialog, objImage, imgFilename
set wsh=CreateObject("wscript.shell")
set fso=CreateObject("scripting.filesystemobject")
set objWIAdialog = CreateObject("WIA.CommonDialog") 

'--- Start the Scanner dialog box, where a scanner can be selected...
set objImage = objWIADialog.ShowAcquireImage

'--- Save and show the scan if the scan was successful...
If Not objImage Is Nothing Then 
    Randomize
    imgFilename=fso.GetSpecialFolder(2) & "\Scan2BMP" &  Int((999999 - 100000 + 1) * Rnd + 100000) & ".jpg" 
    wscript.echo "Scan stored as BMP in file: " & imgFilename
    objImage.SaveFile imgFilename 
    wsh.run(imgFilename)
End if 

Open in new window


It works fine. I would like to tweak it so after it scans, it opens Adobe (I have the full version on Adode CS) instead of windows Image Viewer. I also don’t want to save the file, just have it scan and open in Adobe – is that possible?
LVL 1
tracymsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewCommented:
There is no way to open a PDF document until you save it as a file, so you will have to do that.

As I look at your code, it already includes:

   wsh.run(imgFilename)

This will open the new PDF document using whatever program is the default for PDF type files on your system.  Set that to Adobe Acrobat and you should be all set, it should open the document after saving.


»bp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tracymsAuthor Commented:
Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Document Imaging

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.