RayRay Posted September 9, 2013 Share Posted September 9, 2013 (edited) I'm trying to read a custom task sequence variable in a SCCM 2012 task sequence. Has anyone done this? I can do it in a vb script, just trying to port this to autoit so I can have more functionality. VB looks like this: set env = CreateObject("Microsoft.SMS.TSEnvironment") name = inputbox( prompt for name) env("OSDComputerName") = Name Thanks for any help with this. The vb code is just an example. Edited September 9, 2013 by RayRay Link to comment Share on other sites More sharing options...
SSolheim Posted October 25, 2013 Share Posted October 25, 2013 I think we finally found the one thing VBScript can do that AutoIT can't. I ended up having AutoIT write a VBScript and then launch it. It was a sad day: $CompName = $Prefix & $Serial & $Suffix $TEMP = EnvGet("TEMP") $VBS_Path = $TEMP & "\NameComputer.vbs" $Line1 = 'Set env = CreateObject ( "Microsoft.SMS.TSEnvironment")' & @CRLF FileWrite($VBS_Path, $Line1) $Line1 = 'env ("OSDCOMPUTERNAME") = ' & $CompName & @CRLF FileWrite($VBS_Path, $Line1) $Result = ShellExecuteWait("cscript.exe", $VBS_Path) Exit($Result) I also found that if I was using a 64bit PE then I had to compile a 64bit executable. Apparently, WinPE doesn't support WOW. Link to comment Share on other sites More sharing options...
MaGRauN Posted December 5, 2013 Share Posted December 5, 2013 I'm trying to read a custom task sequence variable in a SCCM 2012 task sequence. Has anyone done this? I can do it in a vb script, just trying to port this to autoit so I can have more functionality. VB looks like this: set env = CreateObject("Microsoft.SMS.TSEnvironment") name = inputbox( prompt for name) env("OSDComputerName") = Name Thanks for any help with this. The vb code is just an example. Hello Rayray Try this $Var = "NAME OF VARIABLE" $SCCM = ObjCreate("Microsoft.SMS.TSEnvironment") $VarResult = $SCCM.Value($Var) taypatte 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now