Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Big Plea. Can anyone help on finishing off a script as completely confused ....  (Read 5004 times)

0 Members and 1 Guest are viewing this topic.

shreked

    Topic Starter


    Rookie

    • Experience: Familiar
    • OS: Windows 7
    Hi

    Ive sort of got my head round what I need to do but need one or two minor adjustments made as I dont know where they go as im totally confused with .msdos unless it written out for me.

    I have the following .MSDOS and  .VBS script that creates a folder &  zips it

    What I need to do in addition  is the following.

    1) When it puts it into a folder I need it to ask me to input a password . When password input I then need it to move onto the .DOS command of zipping

    2) What I also need is instead of it just creating a 7Z file with the name of zipped.7z I need it to be the same name as what the folder was called originally.
    I was advised of some code like this but aint got a clue on what it is or where it to go in script.

    Code: Select all

    @echo off
    echo(The first command line argument is "%~1".

    Code: Select all

    Z:\>example.bat "argA" "argB"
    The first command line argument is "argA".

    CAN I MAKE ONE BIG BIG PLEA AND CAN YOU POSSIBLY AMEND MY SCRIPT BELOW AND JUST REPOST FOR ME PLEASE PLEASE   :'(


     ORIGINAL SCRIPTS  BELOW


    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\icc.cctv\Documents\DONOTDELETE1.bat", 1, True
    set dotbat=Nothing

    @echo off&PUSHD "%PROGRAMFILES%\7-zip"&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
    if '%errorlevel%'=='2' (
    cls&echo ENTER THE STATEMENT INTO FOLDER,
    echo THIS WINDOW WILL CLOSE IN 5 SEC.
    ) else (
    cls
    7z a -t7z "C:\Downloads\zipped.7z" "C:\Downloads"
    echo.&echo ALL FILES MOVED^^!
    )
    timeout 5 /NOBREAK >nul&exit/b


    big big thanks in advance




    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    All you did was re-word your original request which was locked...so i'm lockin this one too.
    " Anyone who goes to a psychiatrist should have his head examined. "