Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mass Print from Multiple directories

Status
Not open for further replies.
Apr 11, 2003
105
US
I have a CD rom that has 500 directories. Each Directory has 100 Tiff files in each. I am trying to write a script to go though each direcotry to print the files in it. i came up with this, but for some reason it dose not print, Can someone take a look and tell me what i am doing worng?

Thanks,

Code:
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
TargetFolder = FSO.GetFolder("C:\00")
Set objFolder = objShell.Namespace(TargetFolder) 
Set colItems = objFolder.Items



Sub ShowSubFolders(Folder)
For Each objFile In Folder.Files

    colItems.Item(i).InvokeVerbEx("Print")
next


end sub
 
Where are you callling your sub ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
actulay trying to combine two working scripts, Once that i know that goes though each folder

Code:
And what about this ?
Set FSO = CreateObject("Scripting.FileSystemObject")
ShowSubfolders FSO.GetFolder("C:\work")

Sub ShowSubFolders(Folder)
For Each objFile In Folder.Files
    If Right(objFile.Name, 2) = ".1" Then
        objFile.Name = Left(objFile.Name, Len(objFile.Name)-1) & "doc"
    End If
Next
For Each Subfolder in Folder.SubFolders
    Wscript.Echo Subfolder.Name
    ShowSubFolders Subfolder
Next
End Sub 
[\code
(you helped me with this one)

and this working code that prints everyhing in a directory

[code]
TargetFolder = "C:\00\01" 
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(TargetFolder) 
Set colItems = objFolder.Items

For i = 0 to colItems.Count - 1
    colItems.Item(i).InvokeVerbEx("Print")
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top