Solved

# VB Script error

Posted on 2013-11-26
322 Views
Hi All,

I am having an issue with the following script which is being run as a startup in GPO.

The GPO actually works fine it pushes our AV to the endpoints.

The error Im getting is a 0x80041002 windows script error line 5 char 1.

See script below..

Many Thanks,

JD

@ECHO OFF
REM --- Check for an existing installation of Sophos AutoUpdate on 32-bit (the 'Sophos AutoUpdate Service' process)
IF EXIST "C:\Program Files\Sophos\AutoUpdate\ALsvc.exe" goto _End
REM --- Check for an existing installation of Sophos AutoUpdate on 64-bit (the 'Sophos AutoUpdate Service' process)
IF EXIST "C:\Program Files (x86)\Sophos\AutoUpdate\ALSVC.exe" goto _End
REM --- Check for an existing installation of Sophos Anti-Virus on 2003/XP (the SAV adapter config file)
REM --- Check for an existing installation of Sophos Anti-Virus on Vista+ (the SAV adapter config file)
REM --- Deploy to Windows 2000/XP/2003/Vista/Windows7/2008/2008-R2
\\T65\SophosUpdate\GPO\EndpointT65.exe -user !Mgmt -pwd test123==
REM --- End of the script
:_End
0
Question by:J_Drake
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 85

Expert Comment

ID: 39678716
The answer is easy: your script is a batch script, not a VB script.
Save it as Whatever.cmd, not as .vbs and try again.
0

Author Comment

ID: 39678755
Sorry.. I meant ~Batch Script. Its saved as a batch script. I wish it were that easy.

Sorry,
0

LVL 8

Expert Comment

ID: 39678758
0x80041002 is a WBEM_E_NOT_FOUND not error.

http://support.microsoft.com/kb/2257980

Can you try to run this as .bat file and run as administrator and let see if same issue. Also try to solve your problem as per above microsoft article also.
0

LVL 14

Expert Comment

ID: 39678761
Code 80041002 is an unusual Error in that a number is returned rather than 'Syntax Error' or other message.

Yes, you need to rename it as filename.vbs

As you saved as Filename.vbs, vbscript compiler thought your VBScript contains a misspelled object name.
0

LVL 85

Accepted Solution

oBdA earned 400 total points
ID: 39678803
This error is coming from the Windows Script Host which processes VB scripts, it does not support batch. Batch is interpreted by cmd.exe.
So either you've posted the wrong script and the error is caused by another one, or there's something else wrong.
Did you maybe associate .cmd with cscript.exe or wscript.exe?
Open a command prompt, try to run the script from there.
If you get the same error, try to run this:
C:\Windows\system32\cmd.exe /k "P:\ath\to\the\script.cmd"
`
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
###### Suggested Courses
Course of the Month5 days, 6 hours left to enroll