I have seen comments on here regarding mutiple posts being duplicated by me. I apologise for that and can I explain that I get confused and the only way I can get my head round it is to ask in a different way.


Im order to clear this up once and for all can I ask a final questions that will finish my posting and annoying you all.


I have the following .VBS
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&
dim dotbat
set dotbat=createobject("wscript.shell")
dotbat.Run "C:\Users\g\Desktop\testersnew.bat", 1, True
set dotbat=Nothing
and the following .BAT File
::start-of-7zipped.bat
@echo off
::goto directory %TEMP%, since this is where this file will make 2 more files
pushd "%TEMP%"
cls
echo MAKE SURE YOU HAVE ENTERED
echo STATEMENT INTO FOLDER BEFORE
echo CONTINUING^^!
echo.
echo [1] I'VE DONE THAT
echo [2] I'VE FORGOTTEN THAT
choice /c 12 /n>nul
::this is a comment: if errorlevel aint 2, so its 1 do the below
if %errorlevel%==2 (
cls
echo ENTER THE STATEMENT INTO FOLDER,
echo THIS WINDOW WILL CLOSE IN 5 SEC.
timeout 5 /NOBREAK >nul
exit/b
)
call :Create-zipit-bat
call :Create-invisible-vbs
call :Zippit
::program exists here
exit/b
::below are subroutines
:Create-zipit-bat
::creates zipit.bat if it does not exist, "you" are currently in directory "%TEMP%"
if not exist "zipit.bat" (
echo 7z a -t7z "C:\Downloads\zipped.7z" "C:\Downloads">"zipit.bat"
)
exit/b
:Create-invisible-vbs
::creates invisible.vbs if it does not exist, "you" are currently in directory "%TEMP%"
if not exist "invisible.vbs" (
echo CreateObject^("Wscript.Shell"^).Run """" ^& WScript.Arguments^(0^) ^& """", 0, False>"invisible.vbs"
)
exit/b
:Zippit
::jump to directory "the below..."
PUSHD "%PROGRAMFILES%\7-zip"
::run your 7zip command line, in the background using a .bat hidden witin a .vbs
wscript.exe "%TEMP%\invisible.vbs" "%TEMP%\zipit.bat"
exit/b
::end-of-7zipped.bat
It creates a folder asking me to name the folder before moving the files of which it does fine. It should then move to .DOS asking me if "ive entered the statement" If I push "YES" it should 7zip the file and saves as zipped .7z .
Im obviously put something in wrong as its not doing that . Is there any way I can sort that out?
Can I also ask if it can be amended and resposted complete on here to avoid any further questions so I can just copy and paste with the following also :-
1) I need it to create a folder and .7zip as it does now but need the following too.
2) When it goes to .7ZIP can I get to name the folder with the same name that was used originally to make the folder instead of saving as a folder called zipped.7z ??
3) when I have created the .7zip folder I need to password protect it.
3) After I 7 zipped 1 folder and have it named can I set it up so that I can .7ZIP another folder that is NOT ZIPPED and ignore all the other folders in the folder.
If 7 zip is too difficult that fine just use the windows zip as long as I can password protect folder after zipping. I not got winzip but would winrar do it provided it not a trial download version.
I would really appriciate this .
Thanks in advance
Tweacle