Jump to content

Covert Powershell script to AUTOIT


chrisdewey
 Share

Recommended Posts

Hi, I have a powershell script that works but i would like to make a .exe file and think the best option is to see if anyone can help me convert it into AutoIT. I am trying to Install font without the need for admin. So I am hoping to convert this to AutoIT script format

 

$SourceDir   = "C:\source\MMP-Fonts\"

$Source      = "C:\source\MMP-Fonts\*"

$Destination = (New-Object -ComObject Shell.Application).Namespace(0x14)

$TempFolder  = "C:\Windows\Temp\Fonts"



# Create the source directory if it doesn't already exist

New-Item -ItemType Directory -Force -Path $SourceDir



New-Item $TempFolder -Type Directory -Force | Out-Null



Get-ChildItem -Path $Source -Include '*.ttf','*.ttc','*.otf' -Recurse | ForEach {

    If (-not(Test-Path "C:\Windows\Fonts\$($_.Name)")) {



        $Font = "$TempFolder\$($_.Name)"

        

        # Copy font to local temporary folder

        Copy-Item $($_.FullName) -Destination $TempFolder

        

        # Install font

        $Destination.CopyHere($Font,0x10)



        # Delete temporary copy of font

        Remove-Item $Font -Force

    }

}

 

Link to comment
Share on other sites

  • Developers
17 minutes ago, chrisdewey said:

So I am hoping to convert this to AutoIT script format

So, what exactly is the question? :) 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Have you check searching for the forum topics we already have?

Try this link: https://www.google.com/search?q=install+font+site%3Awww.autoitscript.com&oq=install+font+site%3Awww.autoitscript.com  :)

Jos 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...