Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB Script error

Posted on 2013-11-26
5
Medium Priority
?
324 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
[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
  • Learn & ask questions
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
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…
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 …

722 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