Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

getting error in set oAutoIt = WScript.CreateObject("AutoItX3.Control")


  • Please log in to reply
5 replies to this topic

#1 AshishBajpai

AshishBajpai

    Seeker

  • New Members
  • 3 posts

Posted 26 May 2012 - 04:10 PM

Hi

when i executed the below mentioned code in editor

set oAutoIt = WScript.CreateObject("AutoItX3.Control")
pid=oAutoIt.ProcessExists("notepad.exe")

If (pid) Then
MsgBox(0,"ashish","PRocess Exists")
Else
MsgBox(0,"ashish","Process does not open")
EndIf


error

error in line: set oAutoIt = WScript.CreateObject("AutoItX3.Control")
I m getting error "process_mgmt.au3 (4) : ==> Missing separator character after keyword.:"

Please tell me where i m incorrect

Thanks,
Ashish







#2 water

water

    ?

  • MVPs
  • 15,069 posts

Posted 26 May 2012 - 04:32 PM

You try to use AutoItX. AutoItx allows to call AutoIt functions from other languages. That means that you can't use AutoIt to compile the source.
Can you please describe what you want to to.

BTW: You posted in the wrong forum. This kind of thread belongs to the "Help and Support" forum.

UDFs:
Active Directory (NEW 2014-07-21 - Version 1.4.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2013-11-10 - Version 0.10.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2013-01-21 - Version 0.3.1.1) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:

ADO - Wiki


#3 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 10,267 posts

Posted 27 May 2012 - 01:39 PM

That code and that error are unrelated. The code you posted is using AutoItX while the error you posted could only come from an executing script.

Edit: Wait are you trying to compile that source in AutoIt? That makes even less sense.

Edited by Richard Robertson, 27 May 2012 - 01:40 PM.


#4 AshishBajpai

AshishBajpai

    Seeker

  • New Members
  • 3 posts

Posted 28 May 2012 - 04:52 PM

If I execute the script in vbsedit then I can successfully execute but I made the changes in the script so that I can execute the script in sciTE4AutoIT editor but I am getting error even I registered the Dll and added the COM component but I am failed to execute the script in scite4AutoIT editor I am learning AutoIt usage with COM objects.

I am not compiling my code I m just executing by pressing F5


Thanks for the replies Water, and Richard

#5 water

water

    ?

  • MVPs
  • 15,069 posts

Posted 28 May 2012 - 04:57 PM

Your code is a mixture of VB and AutoIt. VB calls AutoIt. Therefore you have to execute the script in a VB environment because ScitTE4AutoIt doesn't understand VB.

UDFs:
Active Directory (NEW 2014-07-21 - Version 1.4.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2013-11-10 - Version 0.10.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2013-01-21 - Version 0.3.1.1) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:

ADO - Wiki


#6 AshishBajpai

AshishBajpai

    Seeker

  • New Members
  • 3 posts

Posted 28 May 2012 - 05:34 PM

when we are creating script in autoit and we need to use COM then we need not to use createobject. Directly we can write


Dim $oShell
$oShell=ProcessExists("notepad.exe")

If ($oShell) Then
MsgBox(0,"ashish","Process Exists")
Else
MsgBox(0,"ashish","Process does not open")
EndIf

I executed and it is working.

Thanks to Dear Water and Richard for sincere n quick reply

Regards,
Ashish




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users