Hey guys... can someone refresh my memory, or teach me because I just don't remember.

I've got a script which basically looks like this. This script will be converted to an EXE using AdminScriptEditor. This is done for a couple reasons. Inside the EXE, I include a couple of files; Screensaver, Kixforms.dll, an updated copy of wkix32.exe. The EXE is then used as a Startup Script via GPO.

 Code:
If InStr(@PRODUCTTYPE, "Server") InStr(@PRODUCTTYPE, "Domain Controller") @TsSession = "1"
	Quit ;Exit script if it detects a server or terminal service session.
EndIf

$sAdmin = GetAdministratorName
Shell 'net.exe user ' + $sAdmin + ' Password'

Function GetAdministratorName()
  Dim $sUserSID, $oWshNetwork, $oUserAccount
  $oWshNetwork = CreateObject("WScript.Network")
  $oUserAccounts = GetObject("winmgmts://" + $oWshNetwork.ComputerName + "/root/cimv2").ExecQuery("Select Name, SID from Win32_UserAccount" + " WHERE Domain = '" + $oWshNetwork.ComputerName + "'")
  For Each $oUserAccount in $oUserAccounts
    If Left($oUserAccount.SID, 9) = "S-1-5-21-" And Right($oUserAccount.SID, 4) = "-500"
      $GetAdministratorName = $oUserAccount.Name
    EndIf
  Next
EndFunction



This is all fine, and works for what I intend, however, it appears that the AdminScriptEditor package doesn't really convert it to a full fledged EXE, but rather a package with a runtime engine of some sort. Meaning the code above is in clear text at some point during the process. Now in some cases the temp files that the EXE creates does not remove the script leaving my password in clear text for someone to find.

My question; What would be the best way to encrypt or otherwise obfuscate the password so that it can't be simply read in the event the EXE leaves the temp files.

Suggestions, sample code, etc would be fantastic.

Thanks!