Jump to content


Sign in to follow this  
ryman

Collect Variables in Windows Via HTA for Task Sequence

Recommended Posts

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


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

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
Reply to this topic...

×   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...
Sign in to follow this  

×
×
  • Create New...