1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

VBS - Move file after printing

Discussion in 'Business Applications' started by mechaflash, Mar 28, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. mechaflash

    mechaflash Thread Starter

    Joined:
    Mar 28, 2011
    Messages:
    3
    Hello everyone!

    I retrieved the following script from another post to print multiple files in a directory:

    Code:
    set shApp = createobject("shell.[URL="http://forums.techguy.org/#"]application[/URL]") 
    set shFolder = shApp.namespace("C:\TEST") 
    set shItems = shFolder.Items() 
    for each shItem in shItems 
      shItem.invokeverb "&Print" 
    next
    2 things... it works with PDFs (y)
    and how can I add onto this script to move each completed print job to another directory?
    I figured the command will be inputted after shItem.invokeverb "&Print" but I can't find any website that will give me
    a simple "this is the move command in vbscript". =/

    Thanks in advance!

    ~Mecha
     
  2. mechaflash

    mechaflash Thread Starter

    Joined:
    Mar 28, 2011
    Messages:
    3
    Note: I want the file to be moved directly after the individual print job is completed. this ensures that the file is printed prior to the item being moved, in case if there's a print error with the file etc. maybe add in a statement to only move file if printing is successful?
     
  3. mechaflash

    mechaflash Thread Starter

    Joined:
    Mar 28, 2011
    Messages:
    3
    sorry =P. didn't understand how vbscript worked with commands but now I do. Don't need to know how to deal with moving/copying files (FSO), but there is one thing I wanted to know if anyone else knows XD. If I were to use this to setup a print job for 100+ documents (PDFs), is there a chance that the script will not complete its course due to buffer overflow?

    If there is a chance of it happening, how would I insert a pause after each printjob? For example: print file 1/100, wait 25 seconds, print file 2/100, wait 25 seconds... etc. I've tried wscript.sleep method but it throws an error asking for an object for wscript even though it's already defined.

    If someone has used this to print tons of jobs I'd love to know if it was a success or if there were issues. Thanks!
     
  4. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,507
    First Name:
    Hans
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/988447

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice