none
Can anyone help adding to a VBS command RRS feed

  • Question

  • I have the following VBS script and I need to add to it if poss.

    The script does what I want it to as in create a folder and asks me for the reference number but then I need it to come up with mesage box or something like that asking me where to move the file to after created . I need it to ask me if I want to move to Folder A or B 

    If folder "A" I need it to move to C:\DOCUMENTS\A and if folder "B" I need it to move to C:\DOCUMENTS\B. I also need the folder that it moved to open too. 

    At the end it comes up with a message box and I need to keep that too. 

    Any ideas?

    Code:
    Option Explicit
    
    Const strDLFolder = "C:\CCTV DOWNLOADS\Download"
    Dim objFSO, objWShell, objDLFolder, strNewFolder, objFile
    
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objWShell = CreateObject("WScript.Shell")
    
    
    If Not objFSO.FolderExists(strDLFolder) Then objFSO.CreateFolder(strDLFolder)
    objWShell.CurrentDirectory = strDLFolder
    Set objDLFolder = objFSO.GetFolder(strDLFolder)
    If objDLFolder.Files.Count = 0 Then WScript.Quit
    
    Do
      Err.Clear
      strNewFolder = InputBox("Folder Name", vbLf & "Enter the name of the folder to be created:")
      If strNewFolder = False Then WScript.Quit
      On Error Resume Next
      objFSO.CreateFolder strNewFolder
    Loop While Err.Number <> 0 Or Not objFSO.FolderExists(strNewFolder)
    
    On Error Goto 0
    For Each objFile In objDLFolder.Files
      objFSO.MoveFile objFile.Name, strNewFolder & "\"
    Next
    
    objWShell.Popup "All files moved.", 0, "Done", vbInformation Or vbSystemModal Or &h00040000&
    • Moved by Bill_Stewart Friday, July 27, 2018 9:21 PM This is not "scripts on demand"
    Friday, June 1, 2018 4:51 PM

All replies