Solved

VB Script error

Posted on 2013-11-26
5
310 Views
Last Modified: 2014-01-24
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 I`m 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)
IF EXIST "C:\Documents and Settings\All Users\Application Data\Sophos\Remote Management System\3\Agent\AdapterStorage\SAV\SAVAdapterConfig" goto _End
REM --- Check for an existing installation of Sophos Anti-Virus on Vista+ (the SAV adapter config file)
IF EXIST "C:\ProgramData\Sophos\Remote Management System\3\Agent\AdapterStorage\SAV\SAVAdapterConfig" goto _End
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
Comment
Question by:J_Drake
5 Comments
 
LVL 82

Expert Comment

by:oBdA
Comment Utility
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

by:J_Drake
Comment Utility
Sorry.. I meant ~Batch Script. Its saved as a batch script. I wish it were that easy.

Sorry,
0
 
LVL 8

Expert Comment

by:Mohit Vijay
Comment Utility
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

by:Ram Balachandran
Comment Utility
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 82

Accepted Solution

by:
oBdA earned 400 total points
Comment Utility
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"

Open in new window

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Mapping Drives using Group policy preferences Are you still using old scripts to map your network drives if so this article will show you how to get away for old scripts and move toward Group Policy Preference for mapping them. First things f…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now