Ask a questionAsk a question
 

Answerlaunching hta

  • Tuesday, November 03, 2009 6:44 PMbjohnrini Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I'm launching an .hta from a mdt 2010 task sequence. I want the task sequence to continue without the user responding to the .hta.
    currently, the task sequence waits until the .hta is closed or responded to. Is it possible to continue even if there is no response.

Answers

  • Tuesday, November 03, 2009 10:32 PMJohan ArwidmarkMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Use code like this (in a vbscript) to kick of the HTA

    Const TemporaryFolder = 2
    Set sTemporaryFolder = oFSO.GetSpecialFolder(TemporaryFolder)
    sFile = oUtility.ScriptDir & "\Z-FinalConfig.hta"
    oFSO.GetFile(sFile).Copy sTemporaryFolder & "\" & oFSO.GetFileName(sFile),True

    'Create the cmd to start the HTA
    sCmd="mshta.exe """ & sTemporaryFolder & "\Z-FinalConfig.hta"" "

    'start the HTA, but don't wait for it to complete - otherwise we will never end the TS.
    oShell.CurrentDirectory = sTemporaryFolder
    sReturn=oShell.run (sCmd,1,False)


    If you want a full example (also works in MDT 2010)

    Final Configuration for Lite Touch, MDT 2008
    http://www.deployvista.com/Default.aspx?tabid=78&EntryID=61

     

    • Marked As Answer bybjohnrini Thursday, November 05, 2009 1:43 AM
    •  

All Replies

  • Tuesday, November 03, 2009 10:32 PMJohan ArwidmarkMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Use code like this (in a vbscript) to kick of the HTA

    Const TemporaryFolder = 2
    Set sTemporaryFolder = oFSO.GetSpecialFolder(TemporaryFolder)
    sFile = oUtility.ScriptDir & "\Z-FinalConfig.hta"
    oFSO.GetFile(sFile).Copy sTemporaryFolder & "\" & oFSO.GetFileName(sFile),True

    'Create the cmd to start the HTA
    sCmd="mshta.exe """ & sTemporaryFolder & "\Z-FinalConfig.hta"" "

    'start the HTA, but don't wait for it to complete - otherwise we will never end the TS.
    oShell.CurrentDirectory = sTemporaryFolder
    sReturn=oShell.run (sCmd,1,False)


    If you want a full example (also works in MDT 2010)

    Final Configuration for Lite Touch, MDT 2008
    http://www.deployvista.com/Default.aspx?tabid=78&EntryID=61

     

    • Marked As Answer bybjohnrini Thursday, November 05, 2009 1:43 AM
    •  
  • Thursday, November 05, 2009 1:43 AMbjohnrini Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks. That helped me accomplish what I wanted.