Jump to content
Sign in to follow this  
TXTechie

AutoIt vs. PowerShell

Recommended Posts

TXTechie

Hello Everyone,

I know that this is an AutoIt forum and that everyone here loves AutoIt (as I do). But, I was hoping that some of you whom might have experience with PowerShell could provide me with a more objective comparison as to whether it makes more sense to use AutoIt or PowerShell as my primary "wrapper" for driving all of the software deployments within my company. Currently, I'm using VBScript for my "wrapper" template, but I'm seriously thinking about switching to either AutoIt or PowerShell.

Which one should I use and why?

Share this post


Link to post
Share on other sites
water

You could use both. Call PowerShell from AutoIt.

Why:

AutoIt is easy to learn. Moving from VBScript to AutoIt shouldn't be a problem.

Powershell is powerfull. Some things that can't be done with AutoIt can be done using PS.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
keldepulo

You could use both. Call PowerShell from AutoIt.

Why:

AutoIt is easy to learn. Moving from VBScript to AutoIt shouldn't be a problem.

Powershell is powerfull. Some things that can't be done with AutoIt can be done using PS.

 

with aut2exe you can create an encrypted executable script embedding everything you need, and than execute them everywhere (on every NT version ) without installing bloaded components ...

have you never tried to do this with vbscript or with powershell ?

Share this post


Link to post
Share on other sites
water

Here is the >link how to combine AutoIt and Powershell.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
TXTechie

Thanks, water! You make some great points - using AutoIt as my primary foundation or "wrapper" I have GUI functions AND I can use PowerShell from within AutoIt (even adding a GUI for PowerShell functionality)! The best of both worlds!

Does anyone else have any suggestions/input?

Share this post


Link to post
Share on other sites
water

Just an observation.

I run PS from Autoit by directly calling powershell.exe to create an Exchange mailbox. It runs forever (about 30 seconds) and uses a huge amount of storage (about 160 MB).

So I use PS only if I can't avoid it.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
JLogan3o13

I would agree with Water - I've used PowerShell in the past, but now only do so when I cannot accomplish something purely with AutoIt (which is rare).


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
scubar

I use AutoIt for the majority of my tasks.

I recently began using Powershell as its far easier/safer to accomplish Active Directory tasks in Powershell than in Autoit though.

Share this post


Link to post
Share on other sites
water

I recently began using Powershell as its far easier/safer to accomplish Active Directory tasks in Powershell than in Autoit though.

Did you have a look at my AD UDF? I'm sure it is faster and easier than PS.

What do you think makes PS safer than AutoIt regarding AD?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
scubar

No offence but I would just much rather use Powershell as it has been designed by Microsoft with an aim to make windows server based tasks easier.

The AD Cmdlets are so easy to work with it makes automating tasks a breeze

Share this post


Link to post
Share on other sites
JLogan3o13

It is a personal choice, to be sure, scubar. I see AutoIt the same way - it has been designed to work with the Windows API, and to make tasks easier (not only server tasks). And from my personal use of the AD Cmdlets, I have only found one task out of literally hundreds of scripts that I could not do more easily in AutoIt. It's all about your experiences with a language, I guess :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
water

No offence taken :)

If you feel better using PS to interact with AD, fine. The AD UDF was started when there was no Powershell available.

As JLogan3o13 said: It is a personal choice.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

icecola321,

is this post related to the subject? Don't understand what you try to tell us. Please use Google translate to create a meaningful english post.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
spudw2k

with aut2exe you can create an encrypted executable script embedding everything you need, and than execute them everywhere (on every NT version ) without installing bloaded components ...

Mostly true, except for the "encrypted" part; the security (integrity) of a complied script has been discussed time and time again on this forum.

I didn't want to leave that (as slight as it may seem) hanging out there.  It could be ill or un-informed info, but I don't want other un-informed users to adopt it.

The ultimate lesson here is, don't script something you aren't willing to risk being seen by prying eyes (such as sensitive names, sites and credentials).

Sorry for the rant.

Anyways, both PowerShell and AutoIt are great.  I mostly have AutoIt experience and it has worked well for me.

Share this post


Link to post
Share on other sites
TXTechie

I have also heard (and experienced some) of the slowness of PowerShell. Just another good reason to go with AutoIt.

I have decided to go ahead an migrate my template from VBScript to AutoIt.

I want to thank everyone for their input!

Share this post


Link to post
Share on other sites
spudw2k

Despite what new members may think--specifically one's who want something for nothing or clearly disregard the rules--this forum is a great resource/community for learning; so please don't hesitate to ask for help when needed.

  • Like 1

Share this post


Link to post
Share on other sites
TXTechie

Thank you, spudw2k. And, I agree with you - this community has already helped me and if I'm going to be using AutoIt even more than I have in the past, I fully expect to be here in the forums more often.  :rolleyes:

Share this post


Link to post
Share on other sites
Starstar

I do not know about powershell. But i must say one thing "autoit is an easiest tool in programming". 


Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once."

Share this post


Link to post
Share on other sites
water

Adnan,

do you really think this helps the OP? Would be better posted in the Chat section.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
JLogan3o13

I do not know about powershell. But i must say one thing "autoit is an easiest tool in programming". 

 

Adnan, every time you start spamming threads with these irrelevant posts you get warned by a Mod. How long before you actually learn?

Back on topic - the other big difference in my mind is GUI goodness in AutoIt. I much prefer building a GUI in AutoIt (despite the limitation in the look and feel of windows) rather than a wpf app in PowerShell.


√-1 2^3 ∑ π, and it was delicious!

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  

  • Similar Content

    • greichert
      By greichert
      I am running an exe, that copies a seperate exe (test123.exe)from my computer and puts it onto a remote server "testserver". Everything  works fine up to this point. I need to run this copied exe (test123.exe) on "testserver" but it keeps running on my computer instead. The code I am using to run the exe is below. What am I doing wrong? How can I get this executable to run on the remote server and not my home computer?
      RunWait( "\\testserver.domain.com\c$\user1\greichert\Desktop\InstallEXE\InstallEXE\test123.exe","\\testserver.domain.com\c$\Users\user1\Desktop\InstallEXE\InstallEXE");run exe  
    • greichert
      By greichert
      I am trying to stop a windows service on a separate server than where my script is running. When I run the following script on the same server as the service I need to stop, it works fine. 
      RunWait(@ComSpec & " /c net stop FascetAgentfv2", @ScriptDir, @SW_HIDE);stop agent But when I change "@ScriptDir" to ""\\newserver\c$\Program Files\test\" and run it on my server nothing happens. I tried to error handle and all it was returning was "2". Any suggestions?
    • ufukreis1212
      By ufukreis1212
      Hello, I am new members. Help me please. I want vbs convert to au3 .
      This vbs code : 
      'deneme Set SystemSet = GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem") strOSArch = GetObject("winmgmts:root\cimv2:Win32_OperatingSystem=@").OSArchitecture Set objNetwork = CreateObject("Wscript.Network") Set wshShell = CreateObject( "WScript.Shell" ) strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" ) Set oShell = WScript.CreateObject("WScript.Shell") proc_arch = oShell.ExpandEnvironmentStrings("%PROCESSOR_ARCHITECTURE%") Set oEnv = oShell.Environment("SYSTEM") strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colMB = objWMIService.ExecQuery("Select * from Win32_BaseBoard") Set colCSes = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem") Set colProcessors = objWMIService.ExecQuery("Select * from Win32_Processor") Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItemsx = objWMIService.ExecQuery( _ "SELECT * FROM Win32_VideoController",,48) '------------------------------------------------------------------- Set obj = GetObject("winmgmts:").InstancesOf("Win32_PhysicalMemory") i = 1 For Each obj2 In obj memTmp1 = obj2.capacity / 1024 / 1024 TotalRam = TotalRam + memTmp1 i = i +1 Next '-------------------------------------------------------------------- Dim objWMIService : Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") Set colItems = objWMIService.ExecQuery("Select Architecture from Win32_Processor") For Each objItem in colItems if objItem.Architecture = 0 then strArchitecture = "x86" end if if objItem.Architecture = 9 then strArchitecture = "x64" end if next '-------------------------------------------------------------------- strComputer = "." ' Local computer strMemory = "" i = 1 set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") set colItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemory") For Each objItem In colItems if strMemory <> "" then strMemory = strMemory & vbcrlf strMemory = strMemory & "Bank" & i & " : " & (objItem.Capacity /1024 /1024) & " Mb" i = i + 1 Next installedModules = i - 1 Set colItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemoryArray") For Each objItem in colItems totalSlots = objItem.MemoryDevices Next '---------------------------------------------------------------------- Set objWMISvc = GetObject( "winmgmts:\\.\root\cimv2" ) Set colItems = objWMISvc.ExecQuery( "Select * from Win32_ComputerSystem" ) For Each objItem in colItems strComputerDomain = objItem.Domain Next for each System in SystemSet For Each objItem in colItemsx For Each objProcessor in colProcessors For Each bbType In colMB MbVendor = bbType.Manufacturer MbModel = bbType.Product MsgBox "İşletim Sistemi : " & System.Caption & vbNewLine & _ "İşletim Sistemi Versionu : " & + System.Version & vbNewLine & _ "Windows Mimari Yapısı: " & strOSArch & vbNewLine & _ "Kullanıcı isminiz: " & objNetwork.UserName & vbNewLine & _ "Bilgisayar ismi: " & strComputerName & vbNewLine & _ "Çalışma Grubu: " & strComputerDomain & vbNewLine & _ "--------------------------------------" & vbNewLine & _ "Anakart: " & MbVendor & " " & "[" & MbModel & "]" & vbNewLine & _ "--------------------------------------" & vbNewLine & _ "Grafik Kartı: " & objItem.Caption & vbNewLine & _ "Driver Version: " & objItem.DriverVersion & vbNewLine & _ "--------------------------------------" & vbNewLine & _ "İşlemci Üreticisi: " & objProcessor.Manufacturer & vbNewLine & _ "İşlemci İsmi: " & objProcessor.Name & vbNewLine & _ "CPU Mimarisi: " & strArchitecture & vbNewLine & _ "İşlemci Çekirdek sayısı: " & oEnv("NUMBER_OF_PROCESSORS") & vbNewLine & _ "--------------------------------------" & vbNewLine & _ "Toplam RAM: " & TotalRam & " MB" & vbNewLine & _ "Toplam Slot: " & totalSlots & vbNewLine & _ "Boş Slot: " & (totalSlots - installedModules) & vbNewLine & _ "Ramlerin bulunduğu slotlar:" & vbcrlf & strMemory,0,"deneme" Next Next Next Next please help me , thanks.
    • JuanFelipe
      By JuanFelipe
       
      Hello friends, I have a query, it happens that I have a matrix nxn, the first column of this contains each cell a number with 21 digits, when I pass this matrix to Excel I obviously write that number as 1,10016E + 20, I solved it by adding a * at the end of each cell, but I want it to be written as a text so that I do not have to remove that *, I searched in Google but could not find an effective solution, thanks in advance. 
    • Puls3
      By Puls3
      Hi, This is my first post on the AutoIt Forums, I most of the time was able to get help from this community by merely searching though google and have been able to solve hundreds of problems this way, though in this case I was incapable of finding a solution to my problem. I am quite confident that it is a user error (And my fault) but I haven't been able to determine what I did wrong, any and all help would be greatly appreciated! I have uploaded my whole script pardon passwords to provide as much information as possible.
      I declared a global array at the top of the script and am having issues when I try to set it's value, and I fail to understand why.
      Error Message:
      "D:\Projects\AutoIt\Arena\Base.au3" (270) : ==> Subscript used on non-accessible variable.:
      $ExpMax[$i] = IniRead($TempSavePath, "Combatant" & $i, "ExpMax", $ExpMax[0])
      $ExpMax^ ERROR
      ConsoleWrite Log:
      Ran.
      Checking launch parameters.
      No launch parameters.
      Initiating load.
      Checking for save file.
      Save file not found.
      Load canceled.
      Loading or creating Combatant 1
      Base.au3
×