VBS script failed to run

(imported topic written by TLSM)

I’ve been trying to run this script and I can’t seem to get it to work.

I had tried many combination of work. It seem like function in QnA but when I create the
exactly and it failed to work.

In QnA:

delete __appendfile

delete temp.vbs

appendfile MsgBox “Hallo”,7, “Who are you?”,x=20000,y=500

copy __appendfile temp.vbs

runhidden wscript.exe temp.vbs

Initially I guess is folder restriction issue so I move the temp.vbs to another folder and code as below:

delete __appendfile

delete temp.vbs

delete “c:\temp.vbs”

appendfile MsgBox “Hallo”,7, “Who are you?”,x=20000,y=500

copy __appendfile temp.vbs

copy temp.vbs “c:\temp.vbs”

runhidden wscript.exe temp.vbs

However it failed to run as well. But for both case in QnA is running perfectly but console itself will hand in “Running” status.

Finally I add runascurrentuser in this code but also failed. It is any issue on my code?

If adding runascurrentuser the task will hang at “evaluation” status and QnA also won’t working.

download http://192.168.1.90:52311/RunAsCurrentUser.exe

delete __appendfile

delete temp.vbs

delete “c:\temp.vbs”

appendfile MsgBox “Hallo”,7, “Who are you?”,x=20000,y=500

copy __appendfile temp.vbs

copy temp.vbs “c:\temp.vbs”

waithidden __Download\RunAsCurrentUser.exe wscript /s temp.vbs

I had struggling for this issue sometime. Appreciate if someone can help to correct mine word.

Thanks

(imported comment written by martinc)

See if this works for you

prefetch RunAsCurrentUser.exe sha1:ee47505ebfb2790b9da8a20ed70e67158e9753d0 size:342528
http://software.bigfix.com/download/bes/util/RunAsCurrentUser-2.0.3.1.exe

delete __appendfile

delete temp.vbs

delete “c:\temp.vbs”

appendfile MsgBox “Hallo”,7, “Who are you?”,x=20000,y=500

copy __appendfile temp.vbs

copy temp.vbs “c:\temp.vbs”

wait __Download\RunAsCurrentUser.exe wscript c:\temp.vbs

(imported comment written by TLSM)

Thanks. But seem like no luck.

The action stop at “Evaluation” status.

(imported comment written by SergioBenavides)

Try to deploy the VBS file locally in the machine and run the following command:

waithidden cscript.exe “C:\temt\Mysample.VBS”

continue if {exit code of action = 0}

(imported comment written by martinc)

Hmm. That did not happen to me. I am attaching the task I created for you to try out.

Also check the bes client log file on the target system. Here is what I see on mine:

============================================

At 20:57:42 -0600 - mailboxsite (http://myserver:52311/cgi-bin/bfgather.exe/mailboxsite5262528)

Relevant - VBS Task (fixlet:506)

At 20:57:42 -0600 -

ActionLogMessage: (action:506) Action signature verified for Downloads

At 20:57:44 -0600 -

ActionLogMessage: (action:506) Non-Distributed - DownloadsAvailable

ActionLogMessage: (action:506) Action signature verified for Execution

ActionLogMessage: (action:506) starting action

At 20:57:44 -0600 - actionsite (http://myserver:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded (Prefetch download manager collected file) prefetch RunAsCurrentUser.exe sha1:ee47505ebfb2790b9da8a20ed70e67158e9753d0 size:342528 http://software.bigfix.com/download/bes/util/RunAsCurrentUser-2.0.3.1.exe (action:506)

Command succeeded delete __appendfile (action:506)

Command succeeded delete temp.vbs (action:506)

Command succeeded delete “c:\temp.vbs” (action:506)

Command succeeded appendfile MsgBox “Hallo”,7, “Who are you?”,x=20000,y=500 (action:506)

Command succeeded (file created) appendfile MsgBox “Hallo”,7, “Who are you?”,x=20000,y=500 (action:506)

Command succeeded appendfile MsgBox “Hallo”,7, “Who are you?”,x=20000,y=500 (action:506)

Command succeeded copy __appendfile temp.vbs (action:506)

At 20:57:45 -0600 - actionsite (http://myserver:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded copy temp.vbs “c:\temp.vbs” (action:506)

Command started - wait __Download\RunAsCurrentUser.exe wscript c:\temp.vbs (action:506)

At 20:57:47 -0600 -

Encryption: optional encryption with no certificate; reports in cleartext

At 20:57:57 -0600 -

Report posted successfully

At 20:57:57 -0600 - actionsite (http://myserver:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded (Exit Code=0) wait __Download\RunAsCurrentUser.exe wscript c:\temp.vbs (action:506)

At 20:58:00 -0600 -

ActionLogMessage: (action:506) ending action

At 20:58:00 -0600 - mailboxsite (http://myserver:52311/cgi-bin/bfgather.exe/mailboxsite5262528)

Not Relevant - VBS Task (fixlet:506)

============================================

If it is stuck at evaluating, then I am going to assume the vbs script launched but for whatever reason it is in the background. Open task manager and see if wscript is running.

(imported comment written by TLSM)

Hi
martinc
,

Thanks alot. I think is my machine wscript.exe got issue.

Now the script working d.

Thank alot for your help.

VBS script package for AV installation is getting failed.

please share the steps, how did you resolve your issue.

The root of the original problem appears to have been that the VBS Script was attempting to display a dialog box to the user and ask them a question. For security reasons (because the BESClient runs as LocalSystem), the BigFix client cannot directly communicate with the end user. This is where the RunAsCurrentUser.exe utility came into play.

Assuming a user is logged in (you should check for this in the targeting relevance) the BigFix client can use the RunAsCurrentUser.exe utility to cause an program/command to be run under the Current User context so that the user can see the dialog boxes and respond to the program/command.

Check to see if, maybe, your AV installation is actually running on the targeted systems, but because it’s running as LocalSystem, the user cannot see or interact with the program. Because most AV programs require the user installing them to be a Local Administrator, you may need to find a way to run it “Silently” with no user interactions unless all of your users are also Local Administrators on their computers (bad idea BTW).

Which AV package are you attempting to install?

SEP latest version and it is packaged in vbs script

I’ve done SEP installations before.

There should be a client installation folder with a setup.exe based installer.

I’ve always used the command-line “setup.exe /s” to initiate a silent SEP installation.

Make sure that your SEP administrator has exported the client installer as an EXE based installation package.

1 Like

Ok. that means package creation is not required as we can run the setup file directly from SW distribution.
but in servers reboot is required so can we do that in the commandline too.

We always configured the client installer to NOT force a reboot, and then used the BES Client to control the Post Install Reboot.

waithidden __Download\setup.exe /s

action may require restart
1 Like

thank you very much

regards,
Raj