can a .vbs call a .cmd to run as admin ?

Discussion in 'Scripting' started by tnx, Jan 24, 2014.

  1. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,622
    234
    60
    hi all,

    tn messing about wasting some time.

    What it is when your run a DISM command I thought it would be nice to not have the command window show.
    after some searching I found you could call a.cmd from a .vbs which made the command window invisible.

    I have tested this on some .cmd's I have and it seems to work ok.

    I try to point this invisible.vbs at a DISM command and it does not work.

    My thinking is because the DISM command has to be run as admin.

    I have tried to find out how to tell the .vbs to run the .cmd as admin but I have failed and come up with nothing that works.

    My scripting skills are not very good, even though I do try I sort of end up looking at it the wrong way.:confused:

    So if one of you clever lot could give me a pointer or two that would be great..:cool:

    Thnaks :biggrin:

    Would the invisible.vbs have to be in the same DIR as the DIS .cmd ? ( think I tried this though ) :)
     
  2. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,622
    234
    60
    sort of worked it out.

    Decided to make a nice little GUI to mount the install.wim using Autoplay Media Studio...

    Got it to mount an image without any command window.
    Show a message box saying "Please Wait DISM Is Mounting install.wim"
    When the image is mounted the first message box closes and a new message box tells me the image has bee mounted.