Welcome to the IDM Forum. This forum is meant as a user-to-user support mechanism where users can share knowledge and tips for all IDM software.
Since these forums are user-to-user based, IDM does not regularly read or reply to the posts in this forum. For problem reports, suggestions, or feature requests, you must email us directly. Our trained technical support staff answers most inquiries within 30 minutes.

IDM wrote:Thank you for your message, and I apologize for the trouble with this. We recently had another user report this, and our developers have been notified of the issue. We will correct this in a future update, and we'll email you as soon as it's available.


'--
'-------------------------------------------------------------------------
'-- --
'-- _/_/_/_/ _/_/_/ _/_/ _/_/_/ _/_/_/ --
'-- _/ _/ _/ _/ _/ _/ _/ _/ _/ --
'-- _/_/_/ _/ _/ _/_/_/ _/ _/ _/ _/_/ --
'-- _/ _/ _/ _/ _/ _/ _/ _/ _/ --
'-- _/_/_/_/ _/ _/ _/ _/_/ _/_/_/ _/_/_/ --
'-- --
'-------------------------------------------------------------------------
'--
'********************************************************************************
'* Name : RestUECodePage.vbs
'* Funktie : Script searches for the [File Code Page] section in file
'* %APPDATA%\IDMComp\UltraEdit\UEdit32.INI
'* If the section is found, it is removed.
'*
'* Author : Erik van Roon
'* Dependencies
'* ----------------
'* - None
'* -------------------------------------------------------------------------------
'* Changes:
'* Version When Who What
'* ------- ---------- --- ---------------------------------------------------
'* 1.0 29-12-2011 ERO Initial version
'*********************************************************************************
option explicit
Const cnForReading = 1
Const cnForWriting = 2
Const cnCodePageSection = "[File Code Page]"
Const cnSectionNameStart = "["
Const cnSectionNameEnd = "]"
Dim Fso
Dim File
Dim FileLine
Dim FileContentsNew
Dim CompareMode
Dim CodePageSectionFound
Dim NextSectionFound
Dim filename
Dim ScriptName
ScriptName = Wscript.ScriptName
filename = getfilename
CompareMode = vbTextCompare
Set Fso = CreateObject("Scripting.FileSystemObject")
'Open file for reading
If Not Fso.FileExists(filename) Then
ReportError "Unable to find file: " & vbCrLf & vbCrLf & filename
End If
Set File = Fso.OpenTextFile(FileName, cnForReading)
'Change contents
CodePageSectionFound = False
NextSectionFound = False
Do Until File.AtEndOfStream
FileLine = File.ReadLine
CodePageSectionFound = CodePageSectionFound _
Or Trim(FileLine) = cnCodePageSection
NextSectionFound = NextSectionFound _
Or (CodePageSectionFound _
And Trim(FileLine) <> cnCodePageSection _
And Left(Trim(FileLine),1) = cnSectionNameStart _
And Right(Trim(FileLine),1) = cnSectionNameEnd _
)
'Only include current line in new file version if before or after cnCodePageSection
If Not CodePageSectionFound _
Or NextSectionFound _
Then
FileContentsNew = FileContentsNew & FileLine & vbCrLf
End If
Loop
File.Close
'Open file for writing, write new contents and close the file
If Not CodePageSectionFound Then
ShowMessage "No changes needed for file " & vbCrLf & vbCrLf & filename
Else
If Not Fso.FileExists(filename) Then
ReportError "Unable to find file: " & vbCrLf & vbCrLf & filename
End If
Set File = Fso.OpenTextFile(FileName, cnForWriting)
File.WriteLine FileContentsNew
File.Close
ShowMessage "Section 'File Code Page' removed from file" & vbCrLf & vbCrLf & FileName
End If
'==============================================================================
'Return name of file that needs to be changed
'==============================================================================
Function GetFileName
Const cnUEDir = "IDMComp\UltraEdit\"
Const cnUEFile = "UEdit32.INI"
Dim AppData
Dim Shell
Set Shell = CreateObject( "WScript.Shell" )
AppData = Shell.ExpandEnvironmentStrings( "%APPDATA%" )
If Right(AppData,1) <> "\" Then
AppData = AppData & "\"
End If
GetFileName = AppData & cnUEDir & cnUEFile
End Function 'GetFileName
'==============================================================================
'Report error and quit
'==============================================================================
Sub ReportError (Message)
MsgBox Message, VBOKOnly, ScriptName & " Script Error"
WScript.quit
End Sub 'ReportError
'==============================================================================
'Show message
'==============================================================================
Sub ShowMessage (Message)
MsgBox Message, VBOKOnly, ScriptName
WScript.quit
End Sub 'ReportError
