Single instance without installing AutoIt

Support for xplorer² free lite version

Moderators: fgagnon, nikos, Site Mods

Demetris
Silver Member
Silver Member
Posts: 217
Joined: 2004 Jul 04, 17:18

Single instance without installing AutoIt

Post by Demetris »

xplorer² can be used in single instance mode by means of an AutoIt or AutoHotKey script. Sample scripts  have been posted in this thread. Users of xplorer² who want single instance but do not want to install, say, AutoIt, may find useful two AutoIt scripts that I compiled into standalone executables:

x2.7z (117 Kb, for the non-Unicode version)
x2_UC.7z (117 Kb, for the Unicode version)

The executables are packed in the 7z format. They can be opened with 7-Zip, WinRAR, and other good archivers.

These compiled scripts do not need AutoIt to run, since they contain the AutoIt engine. They have been tested on Win XP, Greek and English, and work fine. They should also work on 9x systems.

The contained script
To see for yourself if the script is indeed the following, and not, say, some malicious code to reformat your hard drive, :twisted: you can use the AutoIt decompiler. But then the whole purpose of not installing AutoIt is defeated. :wink:

Code: Select all

; Restore xplorer2_UC if running. Else run
#NoTrayIcon
If ProcessExists("xplorer2_UC.exe") Then
	Opt("WinTitleMatchMode", 4)
	WinActivate("classname=ATL:ExplorerFrame", "")
ElseIf Not ProcessExists ("xplorer2_UC.exe") Then
	Run ("xplorer2_UC.exe")
EndIf
Exit
For the non-Unicode version of xplorer², references to the executable are replaced by "xplorer2.exe".

What the script does
It checks if xplorer² is running. If it is, it activates the xplorer² window. If it is not, it starts xplorer².

How to use
The script can be used in many ways. The only requirement is that it resides in the same directory as the xplorer² executable. Here is a way that I find convenient:
  • :arrow: Unpack the exe file to the directory of the xplorer² executable. (for most versions of Windows, English language, the default location is: C:\Program Files\zabkat\xplorer2\)
    :arrow: Send a shortcut icon to the desktop.
    :arrow: Define a shortcut key for the new icon (Properties > Shortcut > Shortcut key), say Ctrl+Alt+X or Ctrl+Alt+2.
    :arrow: When you want to use xplorer², use the shortcut key you assigned.
    :arrow: If you don't need the proper xplorer² shortcut icon for something else (say, starting xplorer² with parameters), you can delete it from the desktop and keep only the new x2 icon.
Edited 20050621: spelling, minor additions