Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB Script error

Posted on 2013-11-26
5
Medium Priority
?
326 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 85

Expert Comment

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

by:J_Drake
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

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

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

by:
oBdA earned 1200 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"

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
Wouldn't it be nice if objects in Active Directory automatically moved into the correct Organizational Units? This is what AutoAD aims to do and as a plus, it automatically creates Sites, Subnets, and Organizational Units.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
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

927 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