;****************************************************************************** ;* Script : MassOpen.au3 ;* ;* Description : Opens a specified list of programs or URLs all at once. ;* ;* Language : Auto-It v3 - http://www.autoitscript.com/autoit3/ ;****************************************************************************** ;* Program History: ;* ;* Version : 1.0.0 ;* Author : Craig H. Rettig ;* Date : 29 Nov 2007 ;* Notes : Initial release ;****************************************************************************** ;* This program is free software. It comes without any warranty, to ;* the extent permitted by applicable law. You can redistribute it ;* and/or modify it under the terms of the Do What The F*** You Want ;* To Public License, Version 2, as published by Sam Hocevar. See ;* http://sam.zoy.org/wtfpl/COPYING for more details. ;****************************************************************************** ; If bad path/exe/etc. set, don't terminate script if Run() doesn't work. Opt("RunErrorsFatal", 0) ; Customization variables Global $AppName = "MassOpen" Global $AppCo = "Craig H. Rettig" Global $AppSite = "http://www.bitbucketheaven.com/software/massopen/" Global $AppSupport = "mailto:support@bitbucketheaven.com" Global $AppVersion = "1.0.0" Global $iniFile = "" ; Set path to .INI file If @compiled = 1 Then $iniFile = StringReplace(@AutoItExe, ".exe", ".ini") Else $iniFile = StringReplace(@ScriptFullPath, ".au3", ".ini") EndIf ; To run an application, we need to specify the folder path. ; This function strips the executable filename off a string, ; returning only the folder the executable resides in. Func GetPath($strApp) Local $intPos $intPos = StringInStr($strApp, "\", 0, -1) Return StringLeft($strApp, $intPos) EndFunc ; Cycle through the .INI file and run the specified files. Func RunApps() Local $strCmd, $strPath Local $intDelay, $x Local $arrShortcut If FileExists($iniFile) Then $intDelay = IniRead($iniFile, "Functionality", "DelayBetween", 2) Else $intDelay = 2 EndIf If FileExists($iniFile) Then ; Get list of applications (max: 64) For $x = 1 to 64 $strCmd = IniRead($iniFile, "Programs", "Prog" & $x, "") $strCmd = StringStripWS($strCmd, 3) If StringLen($strCmd) > 0 Then If (StringLeft($strCmd, 4) = "http") Or (StringLeft($strCmd, 4) = "ftp:") Then Run(@COMSPEC & " /c Start " & $strCmd, @SystemDir, @SW_MINIMIZE) If $intDelay > 0 Then Sleep($intDelay * 1000) EndIf Else If FileExists($strCmd) Then Select Case StringLower(StringRight($strCmd, 3)) = "exe" Run($strCmd) Case StringLower(StringRight($strCmd, 3)) = "bat" Run($strCmd) Case StringLower(StringRight($strCmd, 3)) = "com" Run($strCmd) Case StringLower(StringRight($strCmd, 3)) = "pif" Run($strCmd) Case StringLower(StringRight($strCmd, 3)) = "lnk" $arrShortcut = FileGetShortcut($strCmd) Run($arrShortcut[0] & " " & $arrShortcut[2], $arrShortcut[1], $arrShortcut[6]) Case Else Run(@COMSPEC & " /c Start " & $strCmd, GetPath($strCmd), @SW_MINIMIZE) EndSelect If $intDelay > 0 Then Sleep($intDelay * 1000) EndIf EndIf EndIf EndIf Next Else MsgBox(48, "No .INI File", "The settings file is missing. Please reinstall this application.") EndIf EndFunc RunApps() Exit