Hi everyone
Im completely new to doing VBS files and looking on the internet im more and more confused by the minute and just aint got a clue how to add to it
So far I have this script that creates a folder/ Asks me to name it and moves files
Option Explicit
Const strDLFolder = "C:\Downloads"
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&
If answer was "YES" after moving files into new folder I need it to ask me to input a password for the folder and then zip the folder. I have 7zip.
Finally after the folder zipped I need it to ask me if I want to move the files to A) AAA DOWNLOADS or B) BBB DOWNLOADS and select which one.
Once selected I need it moved to the one I advised I wanted it moved to.
What I also need if poss when zipped I need it to keep the folder name for the zipped folder the same as the one i created before zipping.
AAA downloads to save to C:\Mydocuments\AAA DOWLOADS
BBB downloads to save to C:\Mydocuments\BBB DOWLOADS
The original UNZIPPED folder I always need moved to C:\Mydocuments\CCC DOWLOADS once zipped file moved into AAA or BBB downloads.
Big Big thanks in advance
Im completely new to doing VBS files and looking on the internet im more and more confused by the minute and just aint got a clue how to add to it
So far I have this script that creates a folder/ Asks me to name it and moves files
Option Explicit
Const strDLFolder = "C:\Downloads"
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&
If answer was "YES" after moving files into new folder I need it to ask me to input a password for the folder and then zip the folder. I have 7zip.
Finally after the folder zipped I need it to ask me if I want to move the files to A) AAA DOWNLOADS or B) BBB DOWNLOADS and select which one.
Once selected I need it moved to the one I advised I wanted it moved to.
What I also need if poss when zipped I need it to keep the folder name for the zipped folder the same as the one i created before zipping.
AAA downloads to save to C:\Mydocuments\AAA DOWLOADS
BBB downloads to save to C:\Mydocuments\BBB DOWLOADS
The original UNZIPPED folder I always need moved to C:\Mydocuments\CCC DOWLOADS once zipped file moved into AAA or BBB downloads.
Big Big thanks in advance
Last edited: