Hi is there a browse for file function? I have a script which uses the browseforfolder function but I would like to go 1 level deeper and browse the file and then copy it using vbs.
I paste my script below that browses by foder.
Thanks
{<
Dim fso
Dim path
Dim oFolder
Dim oSubFolder
Const OverwriteExisting = True
Set Sh = CreateObject("Shell.Application")
Set F = Sh.BrowseForFolder(0, "Choose the folder containing files to transfer", 0, 17)
If F Is Nothing Then WSCript.Quit
transfer = F.Items.Item.Path
Set Sh = CreateObject("Shell.Application")
Set F = Sh.BrowseForFolder(0, "Choose Target Folder", 0, 17)
If F Is Nothing Then WSCript.Quit
Path = F.Items.Item.Path
Set fso = createobject("Scripting.FileSystemObject")
Folder = transfer & "\*"
Set oFolder = fso.GetFolder(Path)
Set colSubfolders = oFolder.Subfolders
For Each oSubfolder in colSubfolders
fso.CopyFolder Folder, path & "\" & oSubFolder.Name & "\", OverwriteExisting
Next
'THIS SCRIPT WILL COPY A FOLDER CONTAINING FOLDERS AND DOCUMENTS ETC TO A SET OF SUBFOLDERS AT A DESTINATION
'BY ALLOWING YOU TO BROWSE !!TO THE FOLDERS <SOURCE & DESTINATION>
I paste my script below that browses by foder.
Thanks
{<
Dim fso
Dim path
Dim oFolder
Dim oSubFolder
Const OverwriteExisting = True
Set Sh = CreateObject("Shell.Application")
Set F = Sh.BrowseForFolder(0, "Choose the folder containing files to transfer", 0, 17)
If F Is Nothing Then WSCript.Quit
transfer = F.Items.Item.Path
Set Sh = CreateObject("Shell.Application")
Set F = Sh.BrowseForFolder(0, "Choose Target Folder", 0, 17)
If F Is Nothing Then WSCript.Quit
Path = F.Items.Item.Path
Set fso = createobject("Scripting.FileSystemObject")
Folder = transfer & "\*"
Set oFolder = fso.GetFolder(Path)
Set colSubfolders = oFolder.Subfolders
For Each oSubfolder in colSubfolders
fso.CopyFolder Folder, path & "\" & oSubFolder.Name & "\", OverwriteExisting
Next
'THIS SCRIPT WILL COPY A FOLDER CONTAINING FOLDERS AND DOCUMENTS ETC TO A SET OF SUBFOLDERS AT A DESTINATION
'BY ALLOWING YOU TO BROWSE !!TO THE FOLDERS <SOURCE & DESTINATION>