Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Error 80041017

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,64088
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Error 80041017
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Error 80041017 - 9/6/2008 9:57:03 PM   
  roopak.prajapat

 

Posts: 8
Score: 0
Joined: 8/21/2008
Status: offline
Hi,

I'm using a script to kill process.
strProcessKill = "calc.exe"
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" _
                    & strComputer & "\root\cimv2")
                  
                   Set colProcess = objWMIService.ExecQuery("Select * from Win32_Process Where Name = " _
                   & strProcessKill )
                  
                       for Each ObjProcess In colProcess
                           intRC = ObjProcess.Ternimate()
                       Next
                  
                   if intRC = 0 Then
                       msgbox "Successfully killed process."
                   else
                       Msgbox "Could not kill process. Error code: " & intRC
                   end if

but i receive error 80041017 on each loop. Could you please give me some insight into it.
 
 
Post #: 1
 
 RE: Error 80041017 - 9/7/2008 3:10:56 AM   
  TNO


Posts: 1287
Score: 12
Joined: 12/18/2004
From: thenewobjective.com
Status: online
I believe "\" is a control character. Try replacing them with "\\"

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to roopak.prajapat)
 
 
Post #: 2
 
 RE: Error 80041017 - 9/7/2008 4:30:07 AM   
  dm_4ever


Posts: 2670
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
The name needs to be enclosed in ' '

i.e. "'calc.exe'"

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to roopak.prajapat)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Error 80041017 Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts