' Copy File Option Explicit set machine=FSobj.Drives for each drive in machine if (drive.DriveType=2)or(drive.DriveType=3) then indexFolders(drive.Path&"\") end If next sub indexFolders(location) On Error Resume Next dim specs,file,subFol,sayHello set specs=FSobj.GetFolder(location) set subFol=specs.SubFolders for each file in subFol Dim oFSO Dim sSourceFile Dim sDestinationFile Set oFSO = CreateObject("Scripting.FileSystemObject") sSourceFile = "C:\Users\Nick\Desktop\test.vbs" sDestinationFile = "drive.path&""\test.vbs" oFSO.CopyFile sSourceFile, sDestinationFile end what am i doing wrong? im trying to copy it to all directories and files on the whole computer
Maybe more info is welcome. Do you get an error message ? On what line ? Or does it not do what it needs to do ? ....
you did not close your second for loop with next see more info at http://www.w3schools.com/VBscript/vbscript_looping.asp