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

Author Topic: Can anyone help in finishing off a script.  (Read 6485 times)

0 Members and 1 Guest are viewing this topic.

shreked

    Topic Starter


    Rookie

    • Experience: Familiar
    • OS: Windows 7
    Can anyone help in finishing off a script.
    « on: April 29, 2018, 01:50:05 PM »
    see below done in error

    « Last Edit: April 29, 2018, 02:31:42 PM by shreked »

    shreked

      Topic Starter


      Rookie

      • Experience: Familiar
      • OS: Windows 7
      Re: Can anyone help in finishing off a script.
      « Reply #1 on: April 29, 2018, 01:57:50 PM »
      I have the script below to create a folder / name it / moves files from C:\Downloads but im trying to add to it but aint got a clue how to.

      After it zipped the file I need it to ask me if I have added the PDF file and If answer is "YES" I need it to ask me to input a password for the folder and then zip the folder. I have 7zip. If answer is "NO" then I need a message stating to attach PDF and then stop running command and await OK button to be clicked.
      .
      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 that I created the same as the one I named 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.

      Any help greatly appriciated. Ive got a cheek but if its only amending the text below is there any chance you could just copy and paste.

      Big Big thanks in advance

      Original script

      Code: [Select]
      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&[/code][/code]
      « Last Edit: April 29, 2018, 02:30:24 PM by shreked »

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Can anyone help in finishing off a script.
      « Reply #2 on: April 29, 2018, 03:15:13 PM »
      shreked,
      How much experience do you have with batch script?
      Do you otherwise use another language?
      Do youuse  sue or have you considered using:
      Java
      Python
      PHP
      Javascript
      C#  or C++
      Powershell
      Vb script
      The above are not necessarily in order of value or popularity.
      What I what to say is that MS-DOS does not behave very much like any of the above tools. MS-DOS dates back many years and is very clumsy. Any of the abode tools might be easier, unless there is a specific need to use on the command line shell in most versions Microsoft Windows.
      Myself, I no longer work in IT. But those who do often mention the last two items above. Vb script has been around awhile and a likely solution would be hybrid use of both batch and Vb script.

      But you can ignore me. Somebody will come here shortly and give  some ideas about your script task.  :)

      DaveLembke



        Sage
      • Thanked: 662
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Can anyone help in finishing off a script.
      « Reply #3 on: April 29, 2018, 06:44:43 PM »
      Warning to anyone who might get involved in this one... The history of this user is odd especially that they dont have admin access to system(s). Additionally their story keeps changing while the intent of what they are trying to do is very similar and they keep getting locked because of suspicious requests. Seems as though as soon as their threads are locked they think they can be sneaky and reword it under a new thread in hopes that someone will give them a script to use for very shady intent.  ::)

      Moderator notified...   :)


      https://www.computerhope.com/forum/index.php/topic,166904.0.html

      shreked

        Topic Starter


        Rookie

        • Experience: Familiar
        • OS: Windows 7
        Re: Can anyone help in finishing off a script.
        « Reply #4 on: May 02, 2018, 09:42:16 AM »
        Ladies and Gents

         Just to advise I am NOT trying to get a script to hack computers and my knowledge/ confidence with VBS scripts /programming etc is ZERO.  This is all completely new to me.

        I apologise on different wording / posts as its just been absolutely doing my head in and getting confused left right and centre..

        Im trying to password protect so I can download and lock folder and then  email the person concerned the password so they can access it.

        Maybe im wrong as everything I looked for has been on the internet to try and help starting it off.

        If anyone can help with the following it would be appreciated.

        As per my original post if anyone can write a script of some sort and it dont matter what type it is I.E MS-DOS / VBS ETC  as long as I can click on a desktop icon and it runs .

        Thanks

        camerongray



          Expert
        • Thanked: 306
          • Yes
          • Cameron Gray - The Random Rambings of a Computer Geek
        • Certifications: List
        • Computer: Specs
        • Experience: Expert
        • OS: Mac OS
        Re: Can anyone help in finishing off a script.
        « Reply #5 on: May 02, 2018, 04:03:40 PM »
        Not sure why this really needs to be done as a script, you can use 7zip to create an encrypted archive.  You can then also use it to create a self extracting archive which will result in a .exe that the end user can extract without needing to install 7zip: https://wikis.utexas.edu/display/coeito/How+To+Create+a+Self-Extracting+Encrypted+Archive+File+With+7-Zip