Alternative Nation
Go Back   Alternative Nation

Notices

View Single Post
Old 21st February 2008, 11:23am   #3
Jushin Liger
Punisher
Moderator
 
Jushin Liger's Avatar
 
Join Date: Sep 2002
Location: Glasgow
Posts: 9,500
Jushin Liger is punker than youJushin Liger is punker than youJushin Liger is punker than youJushin Liger is punker than youJushin Liger is punker than youJushin Liger is punker than youJushin Liger is punker than youJushin Liger is punker than youJushin Liger is punker than youJushin Liger is punker than you
Send a message via MSN to Jushin Liger
Re: Script to print all files in folder and subfolders

I've had a play with that but for some reason it hates the line

Set colItems = objFolder.Items

When I change it to

Set colItems = objFolder.files

It will display the name of each file on the screen but not print them.

Here's my current script

Quote:
Set objFSO = CreateObject("Scripting.FileSystemObject")
TargetFolder = "IingaporeCaley CDR drawings and slidesCDR PACKAGE- 13-2-08IROV"
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(TargetFolder)
Set colItems = objFolder.Items
For Each objItem in colItems
objItem.InvokeVerbEx("Print")
Next
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(TargetFolder)
Set objFolder = objFSO.GetFolder(TargetFolder)
Wscript.Echo objFolder.Path
Set colItems = objFolder.items
For Each objItem in colItems
objItem.InvokeVerbEx("Print")
Next
Wscript.Echo
ShowSubfolders objFSO.GetFolder(objFolder)
Sub ShowSubFolders(Folder)
For Each Subfolder in Folder.SubFolders
Wscript.Echo Subfolder.Path
Set objFolder = objFSO.GetFolder(Subfolder.Path)
Set colFiles = objFolder.items
For Each objItem in colItems
objItem.InvokeVerbEx("Print")
Next
Wscript.Echo
ShowSubFolders Subfolder
Next
End Sub
__________________
No matter where you go, you are what you are player
And you can try to change but that's just the top layer
Man, you was who you was 'fore you got here



http://allannolove.wordpress.com
Jushin Liger is offline   Reply With Quote
 







Powered by vBadvanced CMPS v3.0.0


All times are GMT +0. The time now is 1:26am.

Forums Directory
Copyright 2000-2008, Alternative Nation
Page generated in 0.21398 seconds with 17 queries