Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6063991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:13:52+00:00 2026-05-23T09:13:52+00:00

Okay so here’s the lowdown… been working on this solution for the past week

  • 0

Okay so here’s the lowdown… been working on this solution for the past week or so, thought I had it down but it seems something is amiss… Here’s my code and I’ll give the logic breakdown:

::Programs
SET fox=C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe
SET spool=C:\WINDOWS\system32\PRNJOBS.vbs

::Directories
SET new=C:\PDF\New
SET printing=C:\PDF\Printing
SET finish=C:\PDF\Finish
SET errorfiles=C:\PDF\Error Files

::Important Files
SET syslog=C:\PDF\Script_Messages\PrintLOG.txt
SET emaillog=%tmp%\PrintLOG.txt
SET errlog=C:\PDF\Script_Messages\ErrorLOG.txt
SET emailerr=%tmp%\ErrorLOG.txt

CD "%new%"
MOVE /Y "*.pdf" "%printing%"
CD "%printing%"
FOR %%F IN (*.*) DO (
 START "" /B "%fox%" -p "%%~fF"
 FOR /F "USEBACKQ tokens=1*" %%A IN (`CSCRIPT "%spool%" -l ^| FIND /I "%%F"`) DO (  
  MOVE /Y "%%B" "%finish%\%%~nxf"
  ECHO %%~nxF>>"%syslog%"
  ECHO %%~nxF>>"%emaillog%"
  IF EXIST "%%~fF" (
   MOVE /Y "%%~fF" "%errorfiles%\%%~nxF"
   ECHO *****ERROR PRINTING FILE***** %%~fF>>"%errlog%"
   ECHO *****ERROR PRINTING FILE***** %%~fF>>"%emailerr%"
  )
 )
)

Move files from NEW folder to PRINTING folder. For every file in printing folder, print it using foxit, and for every entry in the PRNJOBS.VBS command in which I find the filename, move the file to finish folder, and echo the log entries for success, then if the file still exists in its old directory, move the file to errorfiles folder and echo the log entires for error in printing.

The script exits without any errors, but it seems like on line 22 is where the script exits. I check the files, and they never get moved to %finish% directory so it has to have been killed on line 22.

If you send a file to your print queue then run

C:\WINDOWS\system32\PRNJOBS.vbs -l

in your CMD you’ll see how that command sends its stdout.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:13:53+00:00Added an answer on May 23, 2026 at 9:13 am

    This may be the cause of the problem:

    MOVE /Y "%%B" "%finish%\%%~nxf"
    

    It should be

    MOVE /Y "%%B" "%finish%\%%~nxF"

    because loop variable names are case sensitive and your loop variable (other than %%A) is declared as %%F.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay i'm stuck on something here. This is the page i'm working on: https://www.passovermeal.org/
Okay, two admissions here, one is I'm sure this question has been answered and
Okay, Here is what I'm trying to do... Right now it is compiling but
Okay, here's my problem: I'm using WatiN to navigate a website, but then a
I know it's not sporting asking for this kind of help, But I've been
Okay so here's the situation. I have this page of data. After the data
Okay, here's my problem. The system I'm working with uses objects called Areas to
Okay, here is my situation: I'm looking for the best design approach. I'm working
Okay, I'm having some serious issues here. I'm new to this site, and new
Okay this is my first post here so please forgive me if i mess

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.