I have used activesetup to call a vbscript when the user logs in. When the user logs in the script is running but it is not doing the exact action for which i have implemented the activesetup. Script will write some registries to HKCU\ hive. Script is working fine without any issues. When i manually execute the script, it does work. But when user logs in, it popups messages but does not do the required stuff. Very stupid and strange.

I spent a lot of time, but of no use. any suggestions please.

0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


if your script works manually then it should work with active setup

stubpath = wscript.exe <path to your vbscript>

did you include your vbscript in the package

is this a vendors msi

can't you use self healing instead
create a top feature (parent) and put all your hkcu keys in this feature
Answered 07/14/2009 by: cygan
Fifth Degree Brown Belt

Please log in to comment
Yes script is working perfectly when I execute it manually.

I have used stubpath = "path of the vbs like " "c:\program files\xxx.vbs"

Yes the xxx.vbs exists in c:\program files\

The requirement was that it should be in vbscript. so no .msi can be used as per the client's requirement.
OOPs. I was scratching my head to find out the reason, finally I am putting the same script in Run registry, which is not a best practise. Please let me know if anyone experienced the same.

One more thing. when user logs in there are some drives which get mapped. Is it because of this . Not sure
Answered 07/14/2009 by: ramesh111k
Purple Belt

Please log in to comment

have included wscript.exe in the stubPath value.

e.g wscript.exe "[ProgramFilesFolder]abc.vbs"
cscript.exe "[ProgramFilesFolder]abc.vbs"
Answered 07/14/2009 by: shweta_kar
Blue Belt

Please log in to comment
No I did not. What I have specified is stubpath = "C:\ProgramFiles\xxx.vbs"

I am executing a vbscript in system context and when user logs in I wanted another script to run to write HKCU registries. So I used activesetup.

and as specified above, i was writing a HKLM registry (activesetup) with the value stubpath = "C:\ProgramFiles\xxx.vbs" .

Please suggest is wscript.exe should be specified mandatorily.
Answered 07/15/2009 by: ramesh111k
Purple Belt

Please log in to comment
Hi ramesh111k,

There are few things you may want to consider when running an active setup especially when it is an executable like your vb script. If you are logging in as a restricted user to run that script via Active Setup, you will not be allowed to execute that. The reason is obvious. The very easy way to populate that HKCU hive is to put your registry in your project, i.e. .WSI, IST or MST if it´s a vendor MSI and populate the Active Setup with a repair.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{GUID}]
"@"="{Nameofyourapp or something}"
"Version"="{Version-i.e. 1,0}"
"StubPath"="msiexec.exe /fu {GUID} /quiet"

If you are persistent and you have some executables to work on to that user if he has admin rights, try what shweta_kar said. Try to list your Active Setup reg keys here and let´s see what we can find out.
Answered 07/15/2009 by: dj_xest
Fifth Degree Black Belt

Please log in to comment
on top of all that, I find active setup to be very unreliable. I'd use a vbscript CA in an MSI that's triggered by an HKCU dummy key.

<edit> I just read the whole thread and apparently an MSI is not an option. Besides, he's deploying HKCU keys with the VB so a CA would be useless.

I think relying on Active Setup for anything is a poor idea.
Answered 07/16/2009 by: turbokitty
Sixth Degree Black Belt

Please log in to comment