Deploying a VBScript to windows 7 client

(imported topic written by cye91)

I created a vbscript which has several processes following.

1:Showing a message box in win7 client and let users enter information I wanted

2:The information is written to the registry of the win7 client as REG_SZ

the registry key is HKEY_LOCAL_MACHINE\software\BigFix\Enterpriseclient\Settings\client\employee ID

*The vbscript is stored in the win7 client

And I created a task in BigFix to execute the vbscript in the win7 client . The action script of the task just has a line like

script “c:\temp\GetInfo.vbs”

But I met a trouble. The trouble is below.

When the vbscript is executed a dialogue box is shown. I upload the picture. Could you please check the attachments .

Does anyone has met this problem? I don’t know how to deal with it and I am very happy that someone can give me some suggestions .

Thanks

cye

(imported comment written by MattBoyd)

For security reasons, Win7 and WinVista services can’t interact directly with the user desktop. This includes the BES service. Since you’re displaying a message box, you’ll need to use RunAsCurrentUser.exe:

prefetch RunAsCurrentUser.exe sha1:5512ef51a98dff1aa910a8189a0361c161fa703f size:212992 http:
//software.bigfix.com/download/bes/util/RunAsCurrentUser-2.0.2.exe waithidden __Download\RunAsCurrentUser.exe --w 
"cscript.exe c:\temp\GetInfo.vbs"

If the user doesn’t have administrator rights, you probably won’t be able to write the value to HKEY_LOCAL_MACHINE\software\BigFix\Enterpriseclient\Settings\client\employee ID because of permissions. You may want to find another location to store the information.

(imported comment written by cye91)

hi boyd

Thank you very much for your answer.

I tested it in my environment and it worked well after adding

color=red

“cmd.exe /c”[/color] string to the code.

like this

prefetch RunAsCurrentUser.exe sha1:5512ef51a98dff1aa910a8189a0361c161fa703f size:212992 http:
//software.bigfix.com/download/bes/util/RunAsCurrentUser-2.0.2.exe waithidden __Download\RunAsCurrentUser.exe --w cmd.exe /c 
"cscript.exe c:\temp\GetInfo.vbs"

Thank you very much!

cye