Jump to content

# [solved] Register SetAcl.ocx - (Moved)

## Recommended Posts

Hi all,

My programming knowledge is very basic.
I have an old script that creates shares and assign permissions. It normally registers SetAcl.ocx if necessary and creates an object to assign permissions.
The command that registers SetAcl was apparently working fine under Windows 7 but is not working under Windows 10.

RunWait("regsvr32.exe path\to\setacl.ocx /s", "", @SW_HIDE)

As I'm logged in as admin, I changed this command to :

RunAsWait(@UserName, "", "", 0, "regsvr32.exe path\to\setacl.ocx /s", "", @SW_HIDE)

It seems to terminate correctly but the script still doesn't work as expected.
To check that, I've created that small script :

Local $objSetAcl = ObjCreate("SETACL.SetACLCtrl.1") If IsObj($objSetAcl) Then
ConsoleWrite("Object successfully created." & @CRLF)
Else
ConsoleWrite("Object not created. Registering SetAcl.ocx" & @CRLF)
Local $result = RunAsWait(@UserName, "", "", 0, "regsvr32.exe path\to\setacl.ocx /s", "", @SW_HIDE); Use of my admin username to elevate CMD ConsoleWrite("Return code : " &$result & @CRLF)
ConsoleWrite("Creating object" & @CRLF)
$objSetAcl = ObjCreate("SETACL.SetACLCtrl.1") If IsObj($objSetAcl) Then
ConsoleWrite("Object successfully created." & @CRLF)
Else
ConsoleWrite("Object creation failed." & @CRLF)
EndIf
EndIf

It tries to register SetAcl.ocx, return code 0 seems to be fine but still can't use SetAcl.
But if I go to CMD as admin, run the regsvr32 command and restart my script, it can create the object without issue.

I know my poor knowledge makes me miss something. Anyone can help me figure this out ?

Edited by bobflumox
solved
##### Share on other sites

What is the exit code of the RunWait ?  Have you checked for @error ?

Not much of a signature but working on it...

Spoiler

##### Share on other sites

@error value is 1

##### Share on other sites
• Moderators

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions.

Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

##### Share on other sites

I get this error when Run cannot access the file for some reason...Maybe you need to add #RequireAdmin ?

Not much of a signature but working on it...

Spoiler

##### Share on other sites

If I add #RequireAdmin, I get a UAC promt when launching the script and then nothing happens.

##### Share on other sites

Your run is not executed properly.  You need to find out why.  It is not an AutoIt issue IMO.  There is something not accessible somewhere on your side.  Unless you can produce a replicable snippet of your problem, I am afraid there is nothing more we can do.

Not much of a signature but working on it...

Spoiler

##### Share on other sites

Solved !
I knew the issue wasn't on my side and not on Autoit's.

##### Share on other sites

Sorry, wrong key combination.
My script was missing the Constants.au3 library. It's working as expected now.
BTW thanks for your help.

##### Share on other sites

Sorry for my stupid replies. Actually I messed things up with my multiple tests.

The problem was that the regsvr32 command doesn't trigger the UAC even if I'm logged in as admin.
Simply adding #RequireAdmin to the script does trigger the UAC. The regsvr32 command works then normally.

## 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
• ### Recently Browsing   0 members

No registered users viewing this page.

• ### Similar Content

• By DevMode
welcome
I need help dealing with a C++ DLL
Specify that I need help with how to use this function
struct libusb_device; typedef struct libusb_context libusb_context; ssize_t LIBUSB_CALL libusb_get_device_list(libusb_context *ctx,libusb_device ***list); My problem is how to deal with "libusb_device ***list"
my code
$libusb_device = DllStructCreate("PTR") Func libusb_init()$Var = DllCall($libusb0, "ptr", "libusb_init",'ptr',$_libusb_device_handle_Ptr) If @error Then Return False Return $Var[1] EndFunc Func libusb_get_device_list() MsgBox(0,VarGetType($_libusb_device_handle_Ptr),$_libusb_device_handle_Ptr)$Var = DllCall($libusb0, "int", "libusb_get_device_list","ptr",$_libusb_device_handle_Ptr,"ptr*",POINTER(POINTER($libusb_device)))$Error = @error If $Error Then Return False MsgBox(0,VarGetType($Var),$Error&@CRLF&$Var) _ArrayDisplay($Var) Return$Var[1] EndFunc
Thank you
iLibUSB.dll iLibUSB_32.dll libusb.h

• Dear members of the forum,
I'm working on a project in which I have to use Image recognition technique.
Due to client restrictions, I couldn't use AutoIt for this project.
Is there a way to use this DLL "ImageSearchDLL.dll" (which is used to do image recognition steps in AutoIt) in VB.Net to achieve the same result?
I have used this DLL few years before and got good results. If there is a latest version of this DLL and if you can share it, that will be helpful too.
Any guidance is deeply appreciated.

• Hi AutoIt Scripters/Programmers. I have a question about MIME Tools for Notepad++:
I've recently found a UDF about Base64 in forum, but they can't decode\encode correctly some emojis , other UTFs and etc. so i decided to use mimeTools.dll of Notepad++ or main site
My problem is how to use this dll in AutoIt Language?

I will be happy with your comments and answers❤ Thanks.

• Good morning Forums
In these days, I am working on a project that involved me to use some Windows APIs to obtain some information about Terminal Servers.
I'm doing this using wtsapi32.dll in a VBA Project, but, the lack of knowledge about few things threated in the articles make this quite difficult to
implement and understand at the same time.
The most difficult thing I'm facing is "translating" C/C++ functions or struct in VBA when pointers are used, or pointers of pointers, and so on.
Since VBA seems to not have a pointer type, to make those functions work I need to implement other functions taken from other DLLs, and this confuses me a lot.
For example, starting from this code, I splitted all the functions and all the definitions to understand why they are there, and why I need to use them.
At the end, I've found out that the code I was going to implement starting from the functions provided in the Microsoft Docs won't be ever be able to work without some supplementary functions which are not mentioned anywhere.
So, I was wondering if someone would please point me out to a good and practical exaplanation about pointers (in general) or specifically for VBA, because I need to use them quite often in these days, and I'd like to understand what I am doing.
Thanks in advance.

Best Regards and Stay at home 🏡

• All my scripts were working fine and now I am getting this error.  How do I resolve it?  Which folder(s) do the DLLs need to be in?
! Dll not found or Call Dll error !
×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...