HTA environment variables?

HTA environment variables?

Post by McKiraha » Sun, 12 Sep 2004 03:33:36


I have an HTA (HTML Application) that builds another HTA and (after writing
it to disk via FSO) invokes MSHTA.EXE to run it.

Is it possible to set an environment variable in the first HTA that is
accessible by the second HTA? If so, how?

Thanks in advance.
 
 
 

HTA environment variables?

Post by McKiraha » Sun, 12 Sep 2004 04:05:52


writing


Perhaps this? I haven't tested it yet.

<< HTA#1 >>

Set objWSS = CreateObject("WScript.Shell")
Set objENV = objWSS.Environment("Process")
objENV("Hello") = "World"

<< HTA #2 >>

Set objWSS = CreateObject("WScript.Shell")
Set objENV = objWSS.Environment("Process")
MsgBox objENV("Hello")


Based on
http://www.yqcomputer.com/
ml/wsproenvironment.asp

"Process" is usewd under Windows 95/98/Me and
"System" is used under Microsoft Windows NT/2000 (and XP? and 2003?)

 
 
 

HTA environment variables?

Post by McKiraha » Sun, 12 Sep 2004 04:16:48


http://www.yqcomputer.com/

Should/can I use "Volatile" in all Windows environments?

Set objENV = objWSS.Environment("Volatile")