Sign in to follow this  
Followers 0

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

6 posts in this topic

#1 ·  Posted

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

Share this post


Link to post
Share on other sites



#2 ·  Posted

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.


My UDFs and Tutorials:

UDFs:
Active Directory (NEW 2015-08-07 - Version 1.2.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2014-07-27 - Version 1.0.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (NEW 2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#4 ·  Posted

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

Share this post


Link to post
Share on other sites

#5 ·  Posted

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.


My UDFs and Tutorials:

UDFs:
Active Directory (NEW 2015-08-07 - Version 1.2.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2014-07-27 - Version 1.0.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (NEW 2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

Share this post


Link to post
Share on other sites

#6 ·  Posted

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0