Checking the functionality of a Batch file and converting the same to VBS

Beantwortet Checking the functionality of a Batch file and converting the same to VBS

  • Dienstag, 10. Juli 2012 07:45
     
     

    Hi All,

    I have a batch file, I need someone to help me understand the batch file in terms of its fucntion. Also need to help me convert it to a vbs as we are not allowed to use bacth file in the new environemnt we are migrating.

    Here is the bacth file.

    @Echo Off
    Set PKNO=4619 
    Set MSIfil=UserReg.msi
    If ."%DimsPath%"==."" Set DimsPath=C:\Tek\Ais
    Set WrkBib=%DimsPath%\%PKNO%

    Rem ---------------------------------------------------------
    Rem -- If IE Explorer is installed and no H:-drive is mapped
    Rem -- then all MSI installs in usercontext will fail because
    Rem -- favorites are redirected to H:-drive in Danske Bank.
    Rem ---------------------------------------------------------

    set xx=no
    if not exist h:\.  set xx=yes

    if %xx%==yes subst h: c:\temp

    MSIEXEC /i "%WrkBib%\LOCAL\USER\SETUP\REGISTRY\%MSIfil%" /q

    if %xx%==yes subst h: /

Alle Antworten

  • Dienstag, 10. Juli 2012 07:53
     
     Beantwortet

    Start here: http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx  This is the location of the learniung resources.

    Post back with a specific question.

    We will help you with the conversion but you have to do the work.


    ¯\_(ツ)_/¯

  • Dienstag, 10. Juli 2012 07:59
     
     Beantwortet

    Here you go:

    Set PKNO=4619 
    Set MSIfil=UserReg.msi
    These instructions set two environmental variables, %PKNO% and "MSlfil".

    If ."%DimsPath%"==."" Set DimsPath=C:\Tek\Ais
    This instruction tests if %DimsPath% (about which we know nothing!) is blank. If it is, it sets it to a path.

    Set WrkBib=%DimsPath%\%PKNO%
    set xx=no
    same as above.

    if not exist h:\.  set xx=yes
    if %xx%==yes subst h: c:\temp
    If drive H: does not exist then set xx to "yes" and create the substituted drive H:.

    MSIEXEC /i "%WrkBib%\LOCAL\USER\SETUP\REGISTRY\%MSIfil%" /q
    Launch the installer.

    if %xx%==yes subst h: /
    Undo the substitution.

    Now that you understand what the batch file does, your task will be to implement the same functionality with your VB Script.