trof Posted May 24, 2013 Share Posted May 24, 2013 I'd like to set default Thunderbird profile with an Autoit script Local $file = FileOpen("C:\Users\Vincenzo\AppData\Roaming\Thunderbird\profiles.ini", 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWriteLine($file, "[Profile1]") FileWriteLine($file, "Name=Posta") FileWriteLine($file, "IsRelative=0") FileWriteLine($file, "Path=D:\Posta\Vincenzo") FileWriteLine($file, "Default=1") FileClose($file) The script works fine, but i'd like to replace C:UsersVincenzo with a relative path I tried Local $file = FileOpen(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", 1) but it doesn't work. Scite editor tell me ""C:Program FilesAutoIt3SciTE..autoit3.exe" /ErrorStdOut "D:AppsscrivifileThunderbird.au3"". Please help me Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 24, 2013 Moderators Share Posted May 24, 2013 (edited) Have you tried with the @AppDataDir macro? Just curious if you get any different behavior. You could also do something like this to confirm you're getting what you expect: $file = @UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini" MsgBox(0, "", $file) Although, if you are editing the ini file, I would suggest using IniWrite rather than FileOpen and FileWrite Edited May 24, 2013 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
trof Posted May 24, 2013 Author Share Posted May 24, 2013 I'm sorry, I made a mistake. $file = @UserProfileDir & "AppDataRoamingThunderbirdprofiles.ini" and Local $file = FileOpen(@UserProfileDir & "AppDataRoamingThunderbirdprofiles.ini", 1) work both well. I don't know what error I made. However thanks to JLogan3o13 for the advice I have another suggestion to ask you. I'd like to replace some elements of this string "Path=D:PostaVincenzo" I want to change "D:" with the letter of my partition data and "Vincenzo" with User name I hope it's clear, tell me if you don't understand. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 24, 2013 Moderators Share Posted May 24, 2013 If you're meaning that you want to be able to add in variables and write them to the file, you should be able to do something like this: $var1 = "C:\" $var2 = @UserName IniWrite(@DesktopDir & "\my.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) This will create the following in the ini [Profile1] Path=C:\Posta\JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
trof Posted May 25, 2013 Author Share Posted May 25, 2013 (edited) This is the script $var1 = "D:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") I need to assign to $var1 the letter of my partition data I'm able to assign it in a batch file. This is what I do: I created a blank text file named partitiondata.txt in my partition data then I write this code to identify the correct letter FOR %%m IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%m:"partitiondata.txt" SET DiscoD=%%m: Is it possible to do the same with Autoit? Edited May 25, 2013 by trof Link to comment Share on other sites More sharing options...
guinness Posted May 25, 2013 Share Posted May 25, 2013 For loop, FileExists and StringSplit are something to look at. Give it a try. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
trof Posted May 25, 2013 Author Share Posted May 25, 2013 Thanks for your advice, I use fileexists function. This is the script. It is not elegant but it works well expandcollapse popupIf FileExists("C:\partitiondata.txt") Then $var1 = "C:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("D:\partitiondata.txt") Then $var1 = "D:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("E:\partitiondata.txt") Then $var1 = "E:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("F:\partitiondata.txt") Then $var1 = "F:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("G:\partitiondata.txt") Then $var1 = "G:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("H:\partitiondata.txt") Then $var1 = "H:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("I:\partitiondata.txt") Then $var1 = "I:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("J:\partitiondata.txt") Then $var1 = "J:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("K:\partitiondata.txt") Then $var1 = "K:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("L:\partitiondata.txt") Then $var1 = "L:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("M:\partitiondata.txt") Then $var1 = "M:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("N:\partitiondata.txt") Then $var1 = "N:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("O:\partitiondata.txt") Then $var1 = "O:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("P:\partitiondata.txt") Then $var1 = "P:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("Q:\partitiondata.txt") Then $var1 = "Q:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("R:\partitiondata.txt") Then $var1 = "R:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("S:\partitiondata.txt") Then $var1 = "S:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("T:\partitiondata.txt") Then $var1 = "T:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("U:\partitiondata.txt") Then $var1 = "U:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("V:\partitiondata.txt") Then $var1 = "V:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("W:\partitiondata.txt") Then $var1 = "W:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("X:\partitiondata.txt") Then $var1 = "X:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("Y:\partitiondata.txt") Then $var1 = "Y:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf If FileExists("Z:\partitiondata.txt") Then $var1 = "Z:\" $var2 = @UserName IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Name", "Posta") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "IsRelative", "0") IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Path", $var1 & "Posta\" & $var2) IniWrite(@UserProfileDir & "\AppData\Roaming\Thunderbird\profiles.ini", "Profile1", "Default", "1") EndIf Please, help me to make the script more professional Link to comment Share on other sites More sharing options...
guinness Posted May 25, 2013 Share Posted May 25, 2013 (edited) Watch this...as I said StringSplt, For loop and FileExists. #include <Constants.au3> Local $aSplit = StringSplit('D E F G H I J K L M N O P Q R S T U V W X Y Z', ' '), _ $sDrive = '', _ $sUserName = @UserName For $i = 1 To $aSplit[0] If FileExists($aSplit[$i] & ':\PartitionData.txt') Then $sDrive = $aSplit[$i] & ':\' IniWrite(@UserProfileDir & '\AppData\Roaming\Thunderbird\profiles.ini', 'Profile1', 'Name', 'Posta') IniWrite(@UserProfileDir & '\AppData\Roaming\Thunderbird\profiles.ini', 'Profile1', 'IsRelative', '0') IniWrite(@UserProfileDir & '\AppData\Roaming\Thunderbird\profiles.ini', 'Profile1', 'Path', $sDrive & 'Posta\' & $sUserName) IniWrite(@UserProfileDir & '\AppData\Roaming\Thunderbird\profiles.ini', 'Profile1', 'Default', '1') ExitLoop EndIf Next If Not ($sDrive = '') Then MsgBox($MB_SYSTEMMODAL, '', 'Drive: ' & $sDrive) Else MsgBox($MB_SYSTEMMODAL, '', 'An error occurred.') EndIf Edited May 25, 2013 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
trof Posted May 25, 2013 Author Share Posted May 25, 2013 Your script is great, thanks. I noticed that if I remove #include <Constants.au3> the script works just as well Link to comment Share on other sites More sharing options...
guinness Posted May 25, 2013 Share Posted May 25, 2013 That's there because I use $MB_SYSTEMMODAL. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
trof Posted May 25, 2013 Author Share Posted May 25, 2013 I removed the last part of your script Link to comment Share on other sites More sharing options...
guinness Posted May 25, 2013 Share Posted May 25, 2013 OK. I just provided a "working example", you can do what you want with the code. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now