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:  Copy  Two  Files  to  Each  of  the  Shared  Folders  on  a  Computer  

 Content of Copy Two Files to Each of the Shared Folders on a Computer.vbs
MD5 Hash: BD661CC008A2CB10B142213031E38C88
Const OverwriteExisting = TRUE

strComputer = "atl-fs-01"

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

Set colItems = objWMIService.ExecQuery("Select * From Win32_Share Where Type = 0")

Set objFSO = CreateObject("Scripting.FileSystemObject")

For Each objItem in colItems
strFolderName = objItem.Name
If InStr(strFolderName, "$") = 0 Then
strPath = "\\" & strComputer & "\" & strFolderName & "\"
objFSO.CopyFile "C:\Scripts\Test.txt", strPath, OverwriteExisting
objFSO.CopyFile "C:\Scripts\Test2.txt", strPath, OverwriteExisting
End If
Next



   © 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