Sign in to follow this  
Followers 0
trof

Relative path

12 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by JLogan3o13

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

Share this post


Link to post
Share on other sites
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.
 

 

 

Share this post


Link to post
Share on other sites

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

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

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by trof

Share this post


Link to post
Share on other sites

For loop, FileExists and StringSplit are something to look at. Give it  a try.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Thanks for your advice, I use fileexists function.

This is the script. It is not elegant but it works well

If 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

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Your script is great, thanks.

I noticed that if I remove  

#include <Constants.au3> 

the script works just as well 

  

 

 

Share this post


Link to post
Share on other sites

That's there because I use $MB_SYSTEMMODAL.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

I removed the last part of your script

Share this post


Link to post
Share on other sites

OK. I just provided a "working example", you can do what you want with the code.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

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  
Followers 0