save this as checkmulti.vbs in your xplorer2 directory, and change the x2path & x2op to your setting.
Code: Select all
Option Explicit
Dim objWMIService,colProcessList,objProcess
Dim objShell,ArgNum,x2path,x2opt,Param
'Define xplorer2 path
x2path="""%Programfiles%\zabkat\xplorer2\xplorer2_UC.exe """
'Define optional flags
x2opt="/T "
'Check input arguments
ArgNum=WScript.Arguments.Count
If ArgNum=0 Then
Param=""
Else
Param=WScript.Arguments.Item(0)
End If
'Check process and start shell
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'xplorer2_UC.exe'")
Set objShell=CreateObject("WScript.Shell")
'Check process
If colProcessList.Count=0 Then
'No current process, start new
objShell.Run x2path & x2opt & """" & Param & """"
Else
'Show current
objShell.AppActivate("xplorer")
'objShell.Sendkeys "^{INSERT}"
objShell.SendKeys "{F10}{BS}{BS}" & Param & "~"
End If
ssave this as x2.reg and run it.
Code: Select all
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\open_x2\command]
@="wscript \"C:\\Program Files\\zabkat\\xplorer2\\checkmulti.vbs\" \"%1\""
[HKEY_CLASSES_ROOT\Folder\shell\open_x2\command]
@="wscript \"C:\\Program Files\\zabkat\\xplorer2\\checkmulti.vbs\" \"%1\""
I only tested this on my own computer, so I don't know if it'll work for others. Just figure other people might want to prevent multiple windows since it's annoying to me.