w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Moving files from one folder to a hot folder BUT only move one at a time when the hot folder is empty

Pretty sure this should do what you want in vbscript:

Set objFS = CreateObject("Scripting.FileSystemObject")
set objFolderA = objFS.GetFolder("c:Folder A")
set objFolderB = objFS.GetFolder("c:Folder B")

For each objFile in objFolderA.Files
    Do While True
        If objFolderB.Files.Count = 0 Then
             objFS.MoveFile objFile.Path, ojbFolderB.Path & ""
             Exit Do
        End If

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.