Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Concatenate  Files  of  the  Same  Name  

 Content of Concatenate Files of the Same Name.vbs
MD5 Hash: A7D5809127EF0F1A3CDA2DEE06180391
Const ForReading = 1
Const ForAppending = 8

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_Datafile Where FileName = 'test' AND Extension = 'vbs'")

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objMainFile = objFSO.OpenTextFile("C:\Scripts\Main_file.txt", ForAppending, True)

For Each objFile in colFiles
Set objFile = objFSO.OpenTextFile(objFile.Name, ForReading)
strContents = objFile.ReadAll
objFile.Close
objMainFile.WriteLine strContents
Next

objMainFile.Close



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a