Sign in to follow this  
Followers 0
robdogg1955

Script wont run after compile

3 posts in this topic

I found a script similar to this one in the forums. It runs fine until I compile it and try to run the executable. It errors out on the StringSplit line. It gives the error {Error: Variable must be of type "Object".}

Here is the script:

#include <Array.au3>
#include <MsgBoxConstants.au3>

Global $System_Info, $Full_ComputerName, $ComputerName, $aArray

$System_Info = ObjCreate("ADSystemInfo")
$ComputerName = $System_Info.ComputerName
$Full_ComputerName = ObjGet("LDAP://" & $ComputerName)
$aArray = StringSplit($Full_ComputerName.Parent, ",")
_ArrayDisplay($aArray, "Computer OU", "", 32)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Do some error handling, and log file writing, to see which of you ADSystemInfo|LDAP objects isn't being created:

If IsObj($yourvariable) Then
  write a success log message
Else
  write a failure log message
endif

If it's not an object, you will get com errors trying to access properties (your failure).

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Do some error handling, and log file writing, to see which of you ADSystemInfo|LDAP objects isn't being created:

If IsObj($yourvariable) Then
  write a success log message
Else
  write a failure log message
endif

If it's not an object, you will get com errors trying to access properties (your failure).

 

I tried your advice and it showed to be an object. Then, I kept looking. I left out the fact that my working directory is a networked drive. I moved everything to my local drive and it is working now. I don't understand that as an issue but it works so all is well. Thank you for your kind input.

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