Auto create txt file containing your string

Status
Not open for further replies.
8 comments
I have a directory that has a lot of folders in it. I want to create a text file containing my string and place them in every folder in the directory.
 
Try this small vbscript code (paste this into a file with .vbs as extension and run it)
PHP:
' ''''''''''''
' Title: Copy file to all sub directories, .vbs
' Author: Soft2050
' Date: 6/2/13
' ''''''''''''
File = InputBox("Enter the file you want to copy to")
Directory = InputBox("Enter directory you want the file to be copied to")

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set subFolders = objFSO.GetFolder(Directory).Subfolders

For Each subFolder in subFolders
    objFSO.CopyFile File, Directory & subFolder.Name & "\"
Next

MsgBox "Done!"
 
Status
Not open for further replies.
Back
Top