The code is functional and feature-complete (for our purposes). But can anyone of you imagine any way to further speed things up? On my system the .exe takes about 3,3 seconds to remove the attribute for about 25 users. It would be perfect if that was done in about 1,5 to 2,0 seconds...any ideas?

Best Regards,

Chris

p.s.: Also "size matters". You know, I know and probably she knows too - how to further lower the executable's size?

Share this post

Link to post

Share on other sites

cherdeg 1

cherdeg 1

The result is even shorter than awaited - and to nothing has to be paid as much attention as I thought before; Microsoft seems to try making it foolproof (even more than I like). The now again working code is:

My mistake: I thought one had to fish out the "full user object" after getting "only" all the account names. But you don't get "only" the account names, you already get the full object in the 1st place. So no second ObjGet is needed, just .Put the changes and .SetInfo - done. The resulting code now takes only 2.8 instead of 3.3 seconds to process the 25 users and the .exe-File is 284 Kbytes in size.

Share this post

Link to post

Share on other sites

cherdeg 1

cherdeg 1

One way to lower the size is to override the icon with a nice small one.

Great...could you please upload the one you used? Don't have an icon generator here...and, btw.: how "to override"?

I very much doubt you will see a performance difference though, not with that method anyhow. Why does it need to be so fast though? Surely you are executing a 1 off change?!

Me too But one has to try...!

As I wrote in my OP, the .exe is meant to be started by a "Run"-entry in the registry of several machines. These machines are used for quite important driver builds and the developers leasing them are not willing to comply our security policies, which explicitly prohibit the use of the "lazy bum"-Attribute "Password never expires". If we manually click off the check, they will set it back the next day. The machines aren't domain members, so GPO is no option also; and local Security offers no option to do this afaik. But these guys are real-life developers; they have no clue of anything except their C++ compilers. So if a utility isn't located in the StartUp-folder, they won't find it. And if it isn't even noticeable (as in: "runs very fast") they won't start digging...

Share this post

Link to post

Share on other sites

rover 40

rover 40

The code is functional and feature-complete (for our purposes). But can anyone of you imagine any way to further speed things up? On my system the .exe takes about 3,3 seconds to remove the attribute for about 25 users. It would be perfect if that was done in about 1,5 to 2,0 seconds...any ideas?

@cherdeg

if using the slow COM method you should add a COM error handler and use IsObj() to check returned objects

Share this post

Link to post

Share on other sites

cherdeg 1

cherdeg 1

nice to have another alternative: GREAT! But on my system it's not a bit faster that the "slow" COM version: 2.8 seconds. But of course you're generally right...if I had a slow computer with a lot of users it would probably play off its advantages.

But concerning code clarity, complexity and manageability...to tweak your version one would need a lot more skills. Never the less I'll try to understand...

Best Regards,

Chris

Edited June 17, 2009 by cherdeg

Share this post

Link to post

Share on other sites

rover 40

rover 40

nice to have another alternative: GREAT! But on my system it's not a bit faster that the "slow" COM version: 2.8 seconds. But of course you're generally right...if I had a slow computer with a lot of users it would probably play off its advantages.

But concerning code clarity, complexity and manageability...to tweak your version one would need a lot more skills. Never the less I'll try to understand...

Best Regards,

Chris

interesting

on one slow machine on my small 3 machine network

clearing target flags of 6 of 11 accounts, I get 3-6 seconds using COM, and about 1 second max using API