Skip to content

Collect Variables in Windows Via HTA for Task Sequence

Featured Replies

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?

  • Author

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)

  • 11 months later...

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:

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.