# VB Script error

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
###### Who is Participating?

Commented:
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

Commented:
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 Commented:
Sorry.. I meant ~Batch Script. Its saved as a batch script. I wish it were that easy.

Sorry,
0

Commented:
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

Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.