0

Hi all i got some problems with this vbs script

set shApp = CreateObject("shell.application")
currentPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".") 
set shFolder = shApp.NameSpace( currentPath )
set files = shFolder.Items()
for each files in files

if files.name <> "2" then
    'msgbox("printing "&files.name) 
                            files.InvokeVerbEx ("Print") 

end if
next

This is supposed to print all the files within the scripts folder BUT it also prints the script's source code, i dont want to print the vbs script itself only the other files how do i do this ? what am i doing wrong ?? 2 is the file name of the script itself 2.vbs

Also how to close word after printing automatically ?

thanks !

3
  • Why wouldn’t you use StrComp in a case like this?
    – Ramhound
    Commented Mar 19, 2021 at 22:07
  • use it where? example ? Commented Mar 19, 2021 at 22:15
  • Instead of your existing comparison. What did you try?
    – Ramhound
    Commented Mar 19, 2021 at 22:44

0

You must log in to answer this question.

Browse other questions tagged .