Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: batch to open pdf files with different pdf viewer  (Read 6857 times)

0 Members and 1 Guest are viewing this topic.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: batch to open pdf files with different pdf viewer
« Reply #15 on: July 01, 2010, 09:40:51 AM »
I couldn't get it to not work when I changed the paths to programs on my system.

You can remove "START", since it's absolutely useless in this context.

Code: [Select]
if (%1)==() goto bad
if "%~dp1"=="D:\My documents\ebooks catalog\" goto book
goto pdf
:book
C:\Program Files\PDF Annotator\PDFAnnotator.exe %1
exit
:pdf
C:\Program Files\Foxit Software\Foxit Reader.exe %1
exit



I was trying to dereference Null Pointers before it was cool.

mat123



    Hopeful

    Thanked: 16
    • Yes
    • Yes
    • Yes
  • Experience: Familiar
  • OS: Windows XP
Re: batch to open pdf files with different pdf viewer
« Reply #16 on: July 01, 2010, 06:19:49 PM »
try this

if (%1)==() goto bad
if "%~dp1"=="D:\My documents\ebooks catalog\" goto book
goto pdf
:book
"C:\Program Files\PDF Annotator\PDFAnnotator.exe" %1
exit
:pdf
"C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe" %1
exit



luxal

    Topic Starter


    Greenhorn

    Re: batch to open pdf files with different pdf viewer
    « Reply #17 on: July 01, 2010, 09:04:41 PM »
    Nope, Keeps flashing, Starts, and exits, and starts again.
    The only way to get out is to restart my PC.

    Thanks guys for your help.
    Maybe I am trying to do something impossible.

    mat123



      Hopeful

      Thanked: 16
      • Yes
      • Yes
      • Yes
    • Experience: Familiar
    • OS: Windows XP
    Re: batch to open pdf files with different pdf viewer
    « Reply #18 on: July 01, 2010, 09:11:54 PM »
    f (%1)==() goto bad
    if "%~dp1"=="D:\My documents\ebooks catalog\" goto book
    goto pdf
    :book
    echo ebook %1
    pause
    exit
    :pdf
    echo pdf %1
    pause
    exit

    tell me the result of regular pdf and pdf in ebook folder
    and no its not immpossipble i got it to work on my computer



    luxal

      Topic Starter


      Greenhorn

      Re: batch to open pdf files with different pdf viewer
      « Reply #19 on: July 05, 2010, 11:00:51 PM »
      Yep this works perfectly.
      Thanks a lot mat123, I appreciate your help and determination.

      All the best