In short this is the code that runs another powershell script:
sAppCmd = "powershell -noexit &'" & ps1Name & "' '" & sUserName & "'"
Wscript.Echo "Running " & sAppCmd
oShell.Run sAppCmd, 4, false
There are no loops here. If the script is in its vbs form, then it runs all nice and dandy. Executes the powershell script and then quits the vbs script. However, if I encode the vbs script to vbe, this all changes. The behaviour is that the vbe executes the powershell but not the powershell script, then the vbe script quits, but before that it restarts in a new window and continues to loop this behaviour until I hit Ctrl-C. Both the vbs and the vbe script are the same code, only difference is that the vbe script is encrypted with Windows Script Encoder. If I comment away line number three and re-encode to vbe, the vbe script will not loop this same way. It almost looks like the vbe version is not to happy to have to deal with oShell.Run and/or the arguments given to it.
Any suggestion for a remedy?