DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: INIalaContro.ahk - AutoHotkey script to generate Launcher.ini  (Read 6,227 times)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Surprise release! (Not even I knew it would be finished today :))

Code: (autohotkey)
; INIalaContro.ahk
; Made for: Contro
; Thread: https://www.donationcoder.com/forum/index.php?topic=52258.0
; 
; Author: publicdomainvic
; License: CC0 1.0 Universal - Public Domain Dedication
; Website: https://publicdomain.is

; Get folder
FileSelectFolder, Folder
Folder := RegExReplace(Folder, "\\$")

; Open Launcher.ini for write
file := FileOpen(Folder . "\\Launcher.ini", "w `n")

; Write header
file.WriteLine("[General]")
file.WriteLine("numRows=25")
file.WriteLine("numCols=9")
file.WriteLine("[Titles]")

; Set paths array
pathArray := Array()

; Loop files and folders
Loop, Files, %Folder%\*.*, FD
{

; Split the path
SplitPath, A_LoopFileLongPath, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive

; Process lnk and url
Switch A_LoopFileExt
	{
	Case "lnk":
		FileGetShortcut, %A_LoopFileLongPath%, OutTarget
		file.WriteLine("Title" . A_Index . "=" . OutNameNoExt)
		pathArray.Push(OutTarget)
	Case "url":
		IniRead, ExtractedURL, %A_LoopFileLongPath%, InternetShortcut, URL
		file.WriteLine("Title" . A_Index . "=" . OutNameNoExt)
		pathArray.Push(ExtractedURL)
	Default:
		file.WriteLine("Title" . A_Index . "=" . OutNameNoExt)
		pathArray.Push(A_LoopFileLongPath)
	}
}

; Print paths
file.WriteLine("[Paths]")

; Loop paths array for write
for index, element in pathArray
{
    file.WriteLine("Path" . index . "=" . element)
}

; Close the file
file.Close()

; Advise user
MsgBox Launcher.ini created!

INIalaContro.ahk file attached.
« Last Edit: April 23, 2022, 09:51 AM by publicdomain »

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,947
Re: INIalaContro.ahk - AutoHotkey script to generate Launcher.ini
« Reply #1 on: April 18, 2022, 09:25 AM »
;D :-* :P

Running to try !!!!!1
« Last Edit: April 23, 2022, 09:51 AM by publicdomain »

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,947
Re: INIalaContro.ahk - AutoHotkey script to generate Launcher.ini
« Reply #2 on: April 18, 2022, 09:33 AM »
;D

I think you are specially inspired !!!!!!!!!!!

:-* :P
« Last Edit: April 23, 2022, 09:51 AM by publicdomain »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Re: INIalaContro.ahk - AutoHotkey script to generate Launcher.ini
« Reply #3 on: April 18, 2022, 03:38 PM »
Glad you liked it :up: I'm happy to help :)
« Last Edit: April 23, 2022, 09:52 AM by publicdomain »

Original address: https://www.donationcoder.com/forum/index.php?topic=52272.0