Jump to content


  • 0
ryman

Collect Variables in Windows Via HTA for Task Sequence

Question

I am working with an HTA frontend to collect information from the user and pass this information to the task sequence for the OS build.

 

I started with advertising the task sequence within Windows to the computer. The user launch the advertisement, it gathers some information and the HTA opens for some user input. This all works fine, the issue is when I try to collect my variables with the object ("Microsoft.SMS.TSEnvironment") I get an error. I understand that I can not use this object just within Windows but, it is being launch by the task sequence in the task sequence.

 

Am I missing something? or How do I pass variables from within Windows I need to the task sequence so I can use them during the build?

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

I believe I have discovered what the issue is but, wonder why others have not run into this issue.

 

I failed to say that I am running ConfigMgr 2007 with MDT 2012 and I am re-deploying Windows 7 x64 onto a Window 7 x64 system.

 

What I have discovered is the task sequence always starts the process in 32-bit. This causes an issue on 64-bit systems because the Microsoft.SMS.TSEnvironment COMObject only works within a 64-bit processes.

 

So I need to find out how to launch the HTA using a 64-bit process not a 32-bit.

 

(There is no issue running the HTA on 32-bit systems)

Share this post


Link to post
Share on other sites

  • 0

Just for the people who are still looking for a solution. Launch the HTA using the following command on a 64 bit machine. ccmexec.exe (SMS service) runs as a 32 bit process on a 64 bit machine. In-order to invoke the 64 bit process of mshta.exe, we've got to call it using the following method in SCCM. if not, windows redirects automagically to the 32 bit version of mshta.exe.

 

%WINDIR%\sysnative\mshta.exe <path-to-the-HTA>

 

and if you are using SCCM 2012 with WinPE 5, use the power of dot net vs HTA (which I still like): An example dotNET application on Microsoft Technet <Click to open technet article>

 

 

2.png

 

3.png

 

Topaz Paul:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.