none
vbscripting help. 8 million questions and I have an answer to a few of them. RRS feed

  • Question

  • So I have a batch script that runs in the old 1980's Atari looking dos style that is ok for my personal use, but I am trying to put something together for others (that may be 99.75% just use what is in front of them) to use.  It is 99.9% working, just one single "no"  at the end throws the script into a fit.  For me it is all yeses so I don't have an issue with it.  The DOS style script I don't have an issue with either.

    99.9% working script in .bat as a cmd project

    @echo off
    echo Instructions for install
    echo Press Enter to continue.
    pause>null
    cls
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    cls
    echo Pick your extra add on.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install extra add on? (y/n)
    set/p start=
    if %start% == y goto Install
    if %start% == n goto next example
    if %start% == yes goto Install
    if %start% == no goto next example
    
    :Install
    echo Installing your extra add on
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\extra content.extension file name"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    cls
    goto next example
    
    :next example
    cls
    echo Next is next example.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install extra add on? (y/n)
    set/p start=
    if %start% == y goto Install
    if %start% == n goto next example
    if %start% == yes goto Install
    if %start% == no goto next example
    
    :Install
    echo Installing your extra add on
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\extra content.extension file name"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    cls
    goto next example
    
    "THIS GOES ON FOR MANY OPTIONS

    This gets followed up with

    :folders
    cls
    echo There is a new folder on desktop labeled extras.
    echo It contains PDF documents for adding things to Print pages, and office documents.
    echo You may keep them, or discard.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.pdf"
    timeout 10>null
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.pdf"
    timeout 10>null
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.pdf"
    timeout 10>null
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.pdf"
    timeout 10>null
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.pdf"
    timeout 10>null
    taskkill /f /im program that this is for.exe >nul 2>&null 2>&1

    Then the fun stuff starts.  If the answer is yes, all good, no, it don't like it.

    :folders
    cls
    echo There is a new folder on desktop labeled extras.
    echo It contains PDF documents for adding things to Print pages, and office documents.
    echo You may keep them, or discard.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.pdf"
    timeout 10>null
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.pdf"
    timeout 10>null
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.pdf"
    timeout 10>null
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.pdf"
    timeout 10>null
    start "" "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.pdf"
    timeout 10>null
    taskkill /f /im program that this is for.exe >nul 2>&null 2>&1
    echo Do you wish to keep these? (y/n)
    
    set/p keep=
    if %keep% == y goto Keep
    if %keep% == n goto Remove
    if %keep% == yes goto Keep
    if %keep% == no goto Remove
    
    :Keep
    goto Delete this batch
    
    :Remove
    rmdir /Q /S  "C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later" >nul 2>&1
    timeout 10>null
    goto Delete this batch
    
    :Delete this batch
    taskkill /f /im program that this is under.exe >nul 2>&1
    echo Starting the program for the add ons.
    cd /d "C:\Program Files\looking for something"
    for /f "delims=" %%a in ('dir /s /b what it is looking for.exe') do set exeLcn="%%a"
    start "what it is looking for.exe" %exeLcn%
    del "C:\Users\Public\Desktop\null"
    del %0

    The questions fly. I use install forge to create everything.

    First issue

    :In DOS there is 2 options (Yy/Nn) and if anything pressed other than these, it just goes to next.

    For now, I have it set to unpack everything to desktop (only for testing purposes only) but will set it to unpack to either %temp% or %program files% later once testing is complete

    Next Issue

    :What does work in vbs.

    Start with instructions.

    Set objShell = CreateObject("Wscript.Shell")
    
    intMessage = Msgbox("Instructions.", _
        vbOKOnly, "Title location")

    Launch a picture and then close (Issue with it that I am not happy with) as .vbs.

    Dim oShell : Set oShell = CreateObject("WScript.Shell")
    oShell.Run ""C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\picture to show.jpg"""
    WScript.Sleep 10000

    Which has a DOS quick show of a taskkill that i would like to not show up at all.

    :Next, I have this that runs as .vbs.

    Set sshShell = CreateObject("WScript.Shell") sshShell.Run """C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\example 1.name of extension""" sshShell.Run """C:\Users\Public\Desktop\extra content\extra content stuff that gets deleted later\example 2.name of extension"""

    'may contain one extension, or up to 10 extensions

    Set objShell = Nothing

    Which is kind of ok.  What it does, it launches the app that the extensions are meant for, but it doesn't wait.  How it is ok, It opens the app the extension is for and installs all at once, which is fine, each has a popup box that says "installed" with an "OK" button.  But it doesn't wait.  (how do I know which "ok" button I push will start the next vbs before all have been pushed)  What isn't ok, it runs each extension one by one and closes.  This will cause the app to start, install extension, close, and then start again for next extension.  So what this does works fine (as far as the grand scheme I am trying to accomplish).

    Set objShell = CreateObject("Wscript.Shell")
    
    intMessage = Msgbox("Would you like to go to install?", _
        vbYesNo, "Testing this.")
    
    If intMessage = vbYes Then
        objShell.Run("what to install .vbs")
    
    'I need this to wait (as stated above, starts the extensions to install wether it is one or 10, launch the app it is for and wait till all options have been clicked "OK" (which hasn't been figured yet)
    Else
        objShell.Run """GOTO NEXT STEP IN INSTALL"""
    End If


    Also i have a bat script that searches and destroys while running the said script above.  (So there is no worry about "Uninstall" and to delete the installer)  there are 2 reasons for this.  Delete extra content

    Now, I have googled running vbscript and google just doesn't get it.

    There is a deference between running a vbs script, and a vbsript that keeps running.

    What I am looking for

    A vbs script that does instructions (which I have), after ok has been hit, continues.  I can make a script that runs all processes just fine, I just havent figured how to make a "running script" (do script "A", wait for response, do script "B", if in script either run different vbscript and wait or go to next.

    So, yeah.  Help needed. First running script "one process to the next while waiting" not "double click to run" and what I haven't asked for "roboCopy" that is silent, and search and delete. Which is as follows in a batch file.

    @echo off
    echo Spring cleaning things from (program that add ons are for).
    echo This will close itself.
    start "" "C:\Users\Public\Desktop\Install extras.bat" (The bat file that does all install options)
    For /F "tokens=*" %%I in ('Dir c:\"program I created from install forge.exe" /s /b') do set FOUND="%%~fI"
    del %FOUND% (Deletes the .exe file that did the install)
    del %0 (Deletes itself)

    This will start the add on batch file, look for the add on (install forge).exe no matter where they put it, start the crappy Atari style DOS installer, and then self delete once it has found the .exe file it is looking for.

    End result in order:

    • Install forge puts all files in either temp file or program files (I can make delete later)
    • Launching from Install forge starts Install first, search and destroy exe that created install and self deletes vbs.
    • That vbs launch the "RUNNING" vbs and have it run while the search and destroy runs in back ground.
    • Second vbs be a running script.   "Instructions" click ok and go to next.  Launch picture and taskkill without confermation or a DOS script that shows taskkill of any posible running tasks associated with a .jpg
    • Wait.  (this vbsript came with a popup, yes runs another vbscript that runs many instances but wait till they have all have been clicked as "OK" before continuing on to next task-vbscript) or contiue "IF ELSE"
    • I can figure out how to launch a .pdf but need a timeout before next .pdf starts, which will open the program they were meant to work with.  (program extensions meant for will close them all, as long as I can get a taskkill without confirmation working)
    • Keep the pdf files that were shown (robocopy folder with all to desktop) and self delete vbs.
    • Don't keep pdf files, delete everythig in temp folder or program folder (whichever location I choose during install) and self delete vbs.

    So this is my 99.9% working batch script part one.

    @echo off
    echo Spring cleaning things from Blubeam Add On installer.
    echo This will close itself.
    start "" "C:\Users\Public\Desktop\Install extras.bat" (location of original test)
    For /F "tokens=*" %%I in ('Dir c:\"Bluebeam Add Ons.exe" /s /b') do set FOUND="%%~fI"
    del %FOUND%
    del %0

    What it starts alongside the delete exe file from Install forge

    @echo off
    echo You may find some of these already installed.  Overwritting "MIGHT" 
    echo provide an update.
    echo Close Bluebeam and "SAVE" all work first.  End of Installer will close for you 
    echo without saving if you skip this part.
    echo Press Enter to continue.
    pause>null
    cls
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\already installed.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    cls
    echo Pick your Profile Add Ons, first is Legal.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\legal.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Legal profile, free add on from Bluebeam? (y/n)
    set/p start=
    if %start% == y goto Install Legal
    if %start% == n goto Oil and Gas profile
    if %start% == yes goto Install Legal
    if %start% == no goto Oil and Gas profile
    
    :Install Legal
    echo Installing Legal profile
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Legal.bpx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    cls
    goto Oil and Gas profile
    
    :Oil and Gas profile
    cls
    echo Next is Oil and Gas Profile.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\oil and gas.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Oil and Gas Profile and Tools, free add on from 
    echo Bluebeam? (y/n)
    set/p start=
    if %start% == y goto Install Oil and Gas
    if %start% == n goto Structural steel
    if %start% == yes goto Install Oil and Gas
    if %start% == no goto Structural steel
    
    :Install Oil and Gas
    echo Installing Oil and Gas Profile and Tools.
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Oil and Gas.bpx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Compressors.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Heat Exchangers.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Isolations Workflow.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Leak Test Workflow.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Line Symbols.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Line Walk Workflow.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Pumps and Turbine.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Valves.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Vessels.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Structural steel
    
    :Structural steel
    cls
    echo Last one, it's Structural Steel.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\structural steel.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Structural steel, free add on from Bluebeam? (y/n)
    set/p start=
    if %start% == y goto Install Structural
    if %start% == n goto Add on tools
    if %start% == yes goto Install Structural
    if %start% == no goto Add on tools
    
    :Install Structural
    echo Installing Structural Steel.
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Structural Steel.bpx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Add on tools
    
    :Add on tools
    cls
    echo Next you can pick your Add on Tools
    echo Press Enter to continue.
    pause>null
    goto Mechanical Tools
    
    :Mechanical Tools
    cls
    echo First one, Mechanical Tools.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Machanical.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Mechanical Tools? (y/n)
    set/p start=
    if %start% == y goto Install Mechanical Tools
    if %start% == n goto Plumbing
    if %start% == yes goto Install Mechanical Tools
    if %start% == no goto Plumbing
    
    :Install Mechanical Tools
    echo Installing Mechanical Tools
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\ASMEY14.5.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\HVAC Duct Symbols and Devices.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\HVAC Heat and Power Devices.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\HVAC Heating and Ventilation.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\HVAC Refrigeration.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\HVAC Valves.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Plumbing
    
    :Plumbing
    cls
    echo Next one is Plumbing Tools.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Plumbing.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Plumbing Tools? (y/n)
    set/p start=
    if %start% == y goto Install Plumbing Tools
    if %start% == n goto Electrical
    if %start% == yes goto Install Plumbing Tools
    if %start% == no goto Electrical
    
    :Install Plumbing Tools
    echo Installing Plumbing Tools
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Plumbing Drains.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Plumbing Fixture Symbols.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Plumbing.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Plumbing Pipe Fittings.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Electrical
    
    :Electrical
    cls
    echo Next one is Electrical Tools.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\electrical.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Electrical Tools? (y/n)
    set/p start=
    if %start% == y goto Install electrical
    if %start% == n goto Interior
    if %start% == yes goto Install electrical
    if %start% == no goto Interior
    
    :Install electrical
    echo Installing Electrical Tools
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\electrical.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Electrical Telecom.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Security and CCTV.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Fire and Life Safety.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Interior
    
    :Interior
    cls
    echo Here we have Interior items.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\appliances.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Furniture and Appliances? (y/n)
    set/p start=
    if %start% == y goto Install Furniture
    if %start% == n goto Architecture
    if %start% == yes goto Install Furniture
    if %start% == no goto Architecture
    
    :Install Furniture
    echo Installing Furniture and Appliances
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Appliance Symbols.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Furniture.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\home furniture.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\kitchen furniture.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\office furniture.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Architecture
    
    :Architecture
    cls
    echo Openings, everyone wants to get to the other side, or at least be able 
    echo to see it.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\doors.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Doors and Windows? (y/n)
    set/p start=
    if %start% == y goto Install Doors
    if %start% == n goto Landscaping
    if %start% == yes goto Install Doors
    if %start% == no goto Landscaping
    
    :Install Doors
    echo Installing Doors and Windows
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Doors.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\windows.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Landscaping
    
    :Landscaping
    cls
    echo Have a seat, watch the birds, and smell the Roses.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\landscape.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Landscaping? (y/n)
    set/p start=
    if %start% == y goto Install Landscaping
    if %start% == n goto People
    if %start% == yes goto Install Landscaping
    if %start% == no goto People
    
    :Install Landscaping
    echo Installing Landscaping
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Landscape Fixtures.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\landscaping tools.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Trees.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto People
    
    :People
    cls
    echo They are everywhere, at the bank, at the store, or playing with their kids 
    echo at the park.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\people.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install People Tools? (y/n)
    set/p start=
    if %start% == y goto Install People
    if %start% == n goto Estimation
    if %start% == yes goto Install People
    if %start% == no goto Estimation
    
    :Install People
    echo Installing people.
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\People.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Estimation
    
    :Estimation
    cls
    echo Have enough space?  Will it fit?  Doing new flooring?
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\estimation.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Estimation Tools? (y/n)
    set/p start=
    if %start% == y goto Install Estimation
    if %start% == n goto Electrical Punch
    if %start% == yes goto Install Estimation
    if %start% == no goto Electrical Punch
    
    :Install Estimation
    echo Installing Estimation Tools.
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Estimation tools.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Electrical Punch
    
    :Electrical Punch
    cls
    echo The dreaded electrical punch lists...  Lets go back and fix things.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\electrical punch.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Electrical Punch List Tools? (y/n)
    set/p start=
    if %start% == y goto Electrical Punch
    if %start% == n goto General Punch
    if %start% == yes goto Electrical Punch
    if %start% == no goto General Punch
    
    :Electrical Punch
    echo Installing Electrical Punch List.
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\electrical punch.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\lighting punch.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto General Punch
    
    :General Punch
    cls
    echo The dreaded general, cieling, and cleaning punch lists...  Lets go back and fix things.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\general and cleaning punch.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install General and Cleaning Punch List Tools? (y/n)
    set/p start=
    if %start% == y goto Install General Punch
    if %start% == n goto Millwork Punch
    if %start% == yes Install General Punch
    if %start% == no goto Millwork Punch
    
    :Install General Punch
    echo Installing General and Cleaning Punch List.
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Punch Keys Ceiling.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Punch Keys Plan.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\cleaning punch.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Millwork Punch
    
    :Millwork Punch
    cls
    echo The dreaded Carpentry and Flooring punch lists...  Lets go back and fix things.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\carpentry and flooring punch.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Carpentry and Flooring Punch List Tools? (y/n)
    set/p start=
    if %start% == y goto Install Millwork Punch
    if %start% == n goto Paint punch
    if %start% == yes Install Millwork Punch
    if %start% == no goto Paint punch
    
    :Install Millwork Punch
    echo Installing Carpentry and Flooring Punch
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\carpentry punch.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\flooring punch.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Paint punch
    
    :Paint punch
    cls
    echo The dreaded Paint punch lists...  Lets go back and fix things.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\paint punch.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Paint Punch List Tools? (y/n)
    set/p start=
    if %start% == y goto install paint punch
    if %start% == n goto Plumbing punch
    if %start% == yes install paint punch
    if %start% == no goto Plumbing punch
    
    :install paint punch
    echo Installing Paint Punch
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\paint punch.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Plumbing punch
    
    :Plumbing punch
    cls
    echo The dreaded Plumbing punch lists...  Lets go back and fix things.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\plumbing punch.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install Plumbing Punch List Tools? (y/n)
    set/p start=
    if %start% == y goto install pumbing punch
    if %start% == n goto Office Tools
    if %start% == yes install pumbing punch
    if %start% == no goto Office Tools
    
    :install pumbing punch
    echo Installing Pumbing Punch
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\plumbing punch.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Office Tools
    
    :Office Tools
    cls
    echo How about some Ofice tools?
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\basic.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install some Ofice tools? (y/n)
    set/p start=
    if %start% == y goto Install Office Tools
    if %start% == n goto Fun 1
    if %start% == yes Install Office Tools
    if %start% == no goto Fun 1
    
    :Install Office Tools
    echo Installing Office Tools.
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Basic.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Flags.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Flowchart.btx"
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Proofreading Symbols.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Fun 1
    
    :Fun 1
    cls
    echo How about a few fun shapes?
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\wingdings.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install some smiley faces and arrows? (y/n)
    set/p start=
    if %start% == y goto Install Fun 1
    if %start% == n goto Fun 2
    if %start% == yes Install Fun 1
    if %start% == no goto Fun 2
    
    :Install Fun 1
    echo Installing a few fun shapes.
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\Wingdings.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Fun 2
    
    :Fun 2
    cls
    echo Feeling a bit spooky on Ol' Hallows Eve?
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\spooktacular.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Would you like to install some Spooktacular Tools? (y/n)
    set/p start=
    if %start% == y goto Install Fun 2
    if %start% == n goto Fun 3
    if %start% == yes Install Fun 2
    if %start% == no goto Fun 3
    
    :Install Fun 2
    echo Installing Spooktacular Tools.
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\spooktacular.btx"
    Timeout 10>null
    echo Press Enter to continue.
    pause>null
    goto Fun 3
    
    :Fun 3
    cls
    echo Everyone has a Christmas Spirit, spread the Joy.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\winter wonderland.jpg"
    timeout 15>null
    taskkill /f /im dllhost.exe >nul 2>&1
    taskkill /f /im mspaint.exe >nul 2>&1
    taskkill /f /im PaintStudio.View.exe >nul 2>&1
    taskkill /f /im WLXPhotoGallery.exe >nul 2>&1
    taskkill /f /im Microsoft.Photos.exe >nul 2>&1
    echo Do you have a Christmas Spirit too? (y/n)
    set/p start=
    if %start% == y goto Install Fun 3
    if %start% == n goto folders
    if %start% == yes Install Fun 3
    if %start% == no goto folders
    
    :Install Fun 3
    echo Installing the Ho Ho Ho!
    start "" "C:\Users\Public\Desktop\Bluebeam extras\add on tools\winter wonderland.btx"
    Timeout 10>null
    echo Finished with installs.  Press Enter to continue.
    pause>null
    goto folders
    
    :folders
    cls
    echo There is a new folder on desktop labeled Bluebeam extras.
    echo It contains PDF documents for adding things to Print pages, and office documents.
    echo You may keep them, or discard.
    Timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\assigned-discipline\Assigned_Discipline.pdf"
    timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\engineering-review\Engineering_Review.pdf"
    timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\submittal-project\Submittal_Project.pdf"
    timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\submittal-review\Submittal_Review.pdf"
    timeout 10>null
    start "" "C:\Users\Public\Desktop\Bluebeam extras\submittal-status\Submittal_Status.pdf"
    timeout 10>null
    taskkill /f /im Revu.exe >nul 2>&1
    rd /s /q "C:\Users\Public\Desktop\Bluebeam extras\add on tools" >nul 2>&1
    echo Do you wish to keep these? (y/n)
    
    set/p keep=
    if %keep% == y goto Keep
    if %keep% == n goto Remove
    if %keep% == yes goto Keep
    if %keep% == no goto Remove
    
    :Keep
    goto Delete this batch
    
    :Remove
    rmdir /Q /S  "C:\Users\Public\Desktop\Bluebeam extras" >nul 2>&1
    timeout 10>null
    goto Delete this batch
    
    :Delete this batch
    taskkill /f /im Revu.exe >nul 2>&1
    echo Starting Bluebeam
    cd /d "C:\Program Files\Bluebeam Software"
    for /f "delims=" %%a in ('dir /s /b Revu.exe') do set exeLcn="%%a"
    start "Revu.exe" %exeLcn%
    del "C:\Users\Public\Desktop\null"
    del %0


    If the extra content file has been selected to not keep, the batch goes nuts, not enough memory to complete task error and doesn't self delete the batch file which on the desktop still.

    All files are located here.  https://support.bluebeam.com/revu-windows-2018/revu-extensions/ which require either winrar or 7zip.  Files must be downloaded as a zip file, extracted, run and deleted along with the original zip file they came from.  To save the "not so tech savvy folks from the heartache, all files have been downloaded and extracted.  All are in the exe file I am trying to create, and all of the extra junk downloaded will be deleted after the chosen install add ons have been installed with option to keep or delete https://support.bluebeam.com/revu-windows-2018/revu-extensions/#stamps in a single folder on the desktop.

    I use the software as well so a working install for me is needed.  But as stated above, selecting yes to all in an .exe/DOS install works fine.  It is the one "no" on keeping extra files that throws the dos into a tailspin.

    Actual vbsripts I have figured out

    Set objShell = CreateObject("Wscript.Shell")
    
    intMessage = Msgbox("What to display in box.", _
        vbOKOnly, "Title location")
    CreateObject("WScript.Shell").Popup "What to display in popup.", 30, "Popup with timer title"
    
         'but don't see a need for it
    Set oShell=WScript.CreateObject("WScript.Shell")
    '(Do you even need FSO?) Set objFSO = Wscript.CreateObject("Scripting.FileSystemObject")
    strSource = Chr(34) & "what to copy" & Chr(34)
    strTarget = Chr(34) & "where to put it" & Chr(34)
    oShell.Run "robocopy " & strSource & " " & strTarget & strParms
    
         'guess this throws the robocopy out of the question
    Dim oShell : Set oShell = CreateObject("WScript.Shell")
    oShell.Run """F:\Michael_JPWHRE\Software\BlueBeam\Bluebeam extras\Bluebeam extras\add on tools\carpentry and flooring punch.jpg"""
    WScript.Sleep 10000
    
    Set objShell = CreateObject("Wscript.Shell")
        objShell.Run """F:\Michael_JPWHRE\Software\BlueBeam\Bluebeam extras\taskkill.bat"""
    
         'but this just runs a taskkill batch file I have created.  Need a real taskkill option without using a .bat file I have to run on side.


    Set sshShell = CreateObject("WScript.Shell")
    sshShell.Run """C:\Users\Public\Desktop\Bluebeam extras\Bluebeam extras\add on tools\Proofreading Symbols.btx"""
    sshShell.Run """C:\Users\Public\Desktop\Bluebeam extras\Bluebeam extras\add on tools\plumbing punch.btx"""
    Set objShell = Nothing
    
       'which is fine when installing many add on tools associated with a particular option, but there is no wait option.  Each instance opens the app the extensions are for and don't want an open/close for each instance.
    Set objShell = CreateObject("Wscript.Shell")
    
    intMessage = Msgbox("Would you like to go to install?", _
        vbYesNo, "Testing this.")
    
    If intMessage = vbYes Then
        objShell.Run """F:\Michael_JPWHRE\Software\BlueBeam\Bluebeam extras\Bluebeam extras\add on tools\install it.vbs"""
    Else
        Wscript.Quit
    End If


    Set objShell = CreateObject("Wscript.Shell")
    
    intMessage = Msgbox("Would you like to go to install?", _
        vbYesNo, "Testing this.")
    
    If intMessage = vbYes Then
        objShell.Run """F:\Michael_JPWHRE\Software\BlueBeam\Bluebeam extras\Bluebeam extras\add on tools\install it.vbs"""
    Else
        objShell.Run """F:\Michael_JPWHRE\Software\BlueBeam\Bluebeam extras\Bluebeam extras\add on tools\skip it.vbs"""
    End If

    And I know a "running" vbsript looks something like this

    'ServerSelection values
    ssDefault = 0
    ssManagedServer   = 1
    ssWindowsUpdate   = 2
    ssOthers          = 3
    
    'InStr values
    intSearchStartChar = 1
    
    
    dim strTitle
    
    
    Set updateSession = CreateObject("Microsoft.Update.Session")
    Set updateSearcher = updateSession.CreateupdateSearcher()
    
    updateSearcher.ServerSelection = ssWindowsUpdate
    Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'")
    
    WScript.Echo "List of applicable items on the machine:"
    
    For I = 0 To searchResult.Updates.Count-1
        Set update = searchResult.Updates.Item(I)
        WScript.Echo I + 1 & "> " & update.Title
    Next
    
    If searchResult.Updates.Count = 0 Then
        WScript.Echo "There are no applicable updates."
        WScript.Quit
    End If
    
    WScript.Echo vbCRLF & "Creating collection of updates to download:"
    
    Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")
    
    For I = 0 to searchResult.Updates.Count-1
        Set update = searchResult.Updates.Item(I)
        addThisUpdate = false
        If update.InstallationBehavior.CanRequestUserInput = true Then
            WScript.Echo I + 1 & "> skipping: " & update.Title & _
            " because it requires user input"
        Else
            If update.EulaAccepted = false Then
                WScript.Echo I + 1 & "> note: " & update.Title & _
                " has a license agreement that must be accepted:"
                WScript.Echo update.EulaText
                WScript.Echo "Do you accept this license agreement? (Y/N)"
                ''strInput = WScript.StdIn.ReadLine
                strInput = "Y"
                WScript.Echo 
                If (strInput = "Y" or strInput = "y") Then
                    update.AcceptEula()
                    addThisUpdate = true
                Else
                    WScript.Echo I + 1 & "> skipping: " & update.Title & _
                    " because the license agreement was declined"
                End If
            Else
                addThisUpdate = true
            End If
        End If
        If addThisUpdate = true Then
            WScript.Echo I + 1 & "> adding: " & update.Title 
            updatesToDownload.Add(update)
        End If
    Next
    
    If updatesToDownload.Count = 0 Then
        WScript.Echo "All applicable updates were skipped."
        WScript.Quit
    End If
        
    WScript.Echo vbCRLF & "Downloading updates..."
    
    Set downloader = updateSession.CreateUpdateDownloader() 
    downloader.Updates = updatesToDownload
    downloader.Download()
    
    Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl")
    
    rebootMayBeRequired = false
    
    WScript.Echo vbCRLF & "Successfully downloaded updates:"
    
    For I = 0 To searchResult.Updates.Count-1
        set update = searchResult.Updates.Item(I)
        If update.IsDownloaded = true Then
            WScript.Echo I + 1 & "> " & update.Title 
            updatesToInstall.Add(update)	
            If update.InstallationBehavior.RebootBehavior > 0 Then
                rebootMayBeRequired = true
            End If
        End If
    Next
    
    If updatesToInstall.Count = 0 Then
        WScript.Echo "No updates were successfully downloaded."
        WScript.Quit
    End If
    
    If rebootMayBeRequired = true Then
        WScript.Echo vbCRLF & "These updates may require a reboot."
    End If
    
    WScript.Echo  vbCRLF & "Would you like to install updates now? (Y/N)"
    ''strInput = WScript.StdIn.ReadLine
    strInput = "Y"
    WScript.Echo 
    
    If (strInput = "Y" or strInput = "y") Then
        WScript.Echo "Installing updates..."
        Set installer = updateSession.CreateUpdateInstaller()
        installer.Updates = updatesToInstall
        Set installationResult = installer.Install()
    	
        'Output results of install
        WScript.Echo "Installation Result: " & _
        installationResult.ResultCode 
        WScript.Echo "Reboot Required: " & _ 
        installationResult.RebootRequired & vbCRLF 
        WScript.Echo "Listing of updates installed " & _
        "and individual installation results:" 
    	
        For I = 0 to updatesToInstall.Count - 1
            WScript.Echo I + 1 & "> " & _
            updatesToInstall.Item(i).Title & _
            ": " & installationResult.GetUpdateResult(i).ResultCode 		
        Next
    End If
    

    Sorry this is long, but I have done my homework.  I just cant get

    vbs create objece

    run instance one and wait

    run instance 2, wait for imput, if yes, wait till complete and continue

       or if no, continue

    rinse and repeat.

    run instance and self delete vbs.

    i can create instances for it to run.

    Monday, June 4, 2018 3:03 AM

All replies