A collection of especially useful xplorer² topics and ideas. New users may find it helpful to look here before searching the other forums for information. >>>>>> Please post new material in the relevant forum. (New stuff posted here will be removed.) Thanks. -fg-

Moderators: fgagnon, nikos

Post Reply
User avatar
Gold Member
Gold Member
Posts: 609
Joined: 2010 Feb 04, 02:15
Location: MeanWhile City


Post by IneedHelp »


Thanks to everyone contributing!
Note: You can post a dummy reply to this thread to stay updated.

User commands:

>>> Archive Management
Zip selected folder(s) to the opposite pane:
>> "[path to 7z.exe]" a -tzip "$I\$N.zip" "$N\"

Unzip selected zip(s) to the opposite pane:
>> "[path to 7z.exe]" x "$N" -o"$I" -r

Test selected archive(s):
$$ "[path to 7z.exe]" t "$F"
UC#0009 / posted by Mr.Pleasant / uses 7-Zip made by Igor Pavlov
Source: user commands: examples and help

Extracts the compressed file to the opposite pane:
>>  "[path to 7z.exe]" x "$N" -o"$I\$B" -r
UC#0018 / posted by profess / uses 7-Zip made by Igor Pavlov
Source: PM
>>> Audio File Handling
> "C:\Program Files (x86)\GoldWave\GoldWave_Record_If_NoFiles.bat" $s
if (%1)==() goto nocontent
if  not exist %1 goto nocontent
"C:\Program Files (x86)\GoldWave\GoldWave.exe" /nosplash %1 %2 %3 %4 %5 %6
"C:\Program Files (x86)\GoldWave\GoldWave.exe" /nosplash -new -record

UC#0013 / posted by Kilmatead / uses GoldWave made by GoldWave Inc.
Source: user commands: examples and help
>>> Batch Only Commands
> "[path to the .bat file displayed below]" "$F" "$I\$N"

UC#0012 / posted by Mr.Pleasant / uses xplorer² made by Zavarakatranemia
Source: user commands: examples and help
>>> DOS Only Commands
$ mkdir "$B"
UC#0010 / posted by profess / uses Windows CMD made by Microsoft
Source: user commands: examples and help

$$ md "$I\$N"
UC#0011 / posted by Mr.Pleasant / uses Windows CMD made by Microsoft
Source: user commands: examples and help
>>> File/Folder Comparison
Compare in normal xplorer2 window:
> windiff $n $i

Compare in scraps xplorer2 window:
> windiff $p $g
UC#0003 / posted by Nikos / uses WinDiff made by Grig Software
Source: user commands: examples and help

> [path to WinMerge.exe]" /r /x /s "$L" "$R"
UC#0008 / posted by Mr.Pleasant / uses WinMerge made by Thingamahoochie Software
Source: user commands: examples and help

> wscript Compare_Handler.vbs "$L" "$R" $A $$ "$G"
' User Command: > wscript Compare_Handler.vbs "$L" "$R" $A $$ "$G"
' Logic:
'   If no files are selected the paths of each pane are compared
'   If 2 items are selected, they are compared to each other
'      Both can be in the same pane or one item highlighted in each pane*
'   * Left/Right orientation is preserved, irrespective of active pane when invoked, so BCompare displays same :)
'      If both panes show the same folder, there's no way to know which was which, so Left/Right is bad fudge :(

const BComp = "C:\Program Files (x86)\Beyond Compare 3\BCompare.exe"

Delim = -1
for i = 0 to Wscript.Arguments.Count - 1                                       ' Find $ Delimiter Position
  if Wscript.Arguments(i) = "$" then Delim = i

Select Case Delim
  Case 2                                                                                 ' No Selections
     if (Wscript.Arguments(0) = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}") _
        or (Wscript.Arguments(1) = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}") then
        wscript.echo "Cannot Compare 'Computer' CLSID"
     end if
     oCompare Wscript.Arguments(0), Wscript.Arguments(1)               ' Compare both panes
  Case 3                                                                                 ' Compare 1 selection from each pane
     matchRight = InStr(Wscript.Arguments(2), Wscript.Arguments(1))
     if (Wscript.Arguments.Count < 5) then                                    ' Only 1 Argument:
        wscript.echo "Nothing to Compare to (Missing Argument)"
     end if

     if (matchRight) then                                                           ' Swap to preserve Left/Right
        oCompare Wscript.Arguments(4), Wscript.Arguments(2)
        oCompare Wscript.Arguments(2), Wscript.Arguments(4)
     end if

  Case else                                                                           ' Compare 2 selections from active pane
     oCompare Wscript.Arguments(2), Wscript.Arguments(3)
end select

' ----------------------------------------------------------

const Quote = """"

sub oCompare (Str1, Str2)
  ' Dim objFSO : Set objFSO = CreateObject( "Scripting.FileSystemObject" )

  'if objFSO.FileExists(Str1) <> objFSO.FileExists(Str2) then                  ' Simple Error Check ** Disabled **
  '   msgbox "Unable to Compare Formats", vbSystemModal + vbCritical + vbOKOnly, "Compare Handler"
  '   wscript.quit
     Dim objShell : Set objShell = CreateObject("WScript.Shell")

     objShell.Run Quote + BComp + Quote + " " + Quote + Str1 + Quote + " " + Quote + Str2 + Quote, 1, False
  'end if

  Set objShell = Nothing  
end sub

UC#0015 / posted by Kilmatead / uses Beyond Compare made by Scooter Software
Source: feature req: more top-level menus
>>> File/Folder Moving
> FlattenFolder.exe "$P"
UC#0016 / posted by snakebyte / uses FlattenFolder made by snakebyte
Source: move a file to a parent folder

The basic User Command syntax is:
> "C:\MoveToParent.exe" $A

If you use x2 2.0, I suggest using the /List=$> command instead, as it allows an infinite number of selections to be safely passed:
> "C:\MoveToParent.exe" /List=$>
UC#0017 / posted by Kilmatead / uses MoveToParent made by Kilmatead
Source: Fun with Womb-Regression Therapy...
>>> File/Folder Renaming
Old command:
>> "[path to renamer.exe]" /enqueue "$F"

New command:
> "C:\Program Files\ReNamer\renamer.exe" /enqueue $S
UC#0006 / posted by Mr.Pleasant / uses ReNamer made by Denis Kozlov
Source: user commands: examples and help
>>> File/Folder Stats
> "[path to WinDirStat.exe]" "$P"
UC#0007 / posted by Mr.Pleasant / uses WinDirStat made by Oliver Schneider
Source: user commands: examples and help
>>> Folder Marking/Coloring
>"C:\Program Files (x86)\Kilmatead\SetFolderColour\SetFolderColour.exe" /Folder=$A /Icon="@SFC\Colour Hue 60.ico" /Notify /Include /Prefix=Desktop_ /AttrINI="-S+HA"
UC#0001 / posted by IneedHelp / uses SetFolderColour made by Kilmatead
Source: This thread
>>> Image Editing
>"C:\Program Files (x86)\GIMP-2.0\bin\gimp-2.6.exe" $S
UC#0014 / posted by Kilmatead / uses GIMP made by GIMP.org
Source: Stochastic User Command Token doesn't like Tarantino...
>>> Image Viewing
> i_view32.exe /filelist=$>
UC#0002 / posted by Kilmatead / uses IrfanView made by Irfan Skiljan
Source: Sequential picture viewing in the scrap window after Search?
>>> Launching/Running Utilities
> charmap
> regedit
> main.cpl

UC#0004 / posted by Mr.Pleasant / uses System Applications made by Microsoft
Source: user commands: examples and help
>>> Text Editing
>> "[path to notepad++.exe]" "$F"
UC#0005 / posted by Mr.Pleasant / uses Notepad++ made by Don HO
Source: user commands: examples and help
User commands descriptions:
UC#0001: Uses SetFolderColour.exe, operates on all selected folders, sets specified icon to all selected folders, outputs default sound notification, copies the specified icon to all selected folders, adds a prefix to the specified icon's file name, sets specified attributes to accompanying INI file

Description: Helps the user mark a single folder or multiple folders by changing their icons to the specified icon. This command also sends a sound notification, copies the icon to the selected folder(s), changes the original icon's name by adding a prefix to it (Desktop_), and also changes the accompanying ini file's attribute (eliminating the System attribute so the user isn't asked for confirmation upon deletion). A lot of these parameters can be omitted or can bare different values. There's also a number of parameters that aren't used by this command, but are available for further customization. Check Kilmatead's application for more information.
UC#0002: Uses i_view32.exe, operates on all selected files

Description: Helps the user view images with IrfanView from multiple locations as if they were all located in a single folder; IrfanView will preview only the selected files, regardless of their path. The command also works on other types of files IrfanView can read, but doesn't go well with 0 bytes files or folders, so refrain from adding those to your initial selection.

Description: I use windiff all the time to compare revisions of code between the working and the backup folder. In the normal case where I use windiff in normal xplorer2 windows (not scrap windows) the arguments i use are > windiff $n $i. Scraps complicate a bit command execution since there is no concept of "current directory.

Description: Simple ones, kind of short-cut commands: Character map, Registry editor, Mouse control.

Description: Opening selected document(s) in Notepad++.

Description: Much better in case you have to rename a lot of files. Just did a test with renaming 1000 files. My old command makes your computer hang in pure panic, whereas the new command works without problems..

Description: Stats with WinDirStat.

Description: WinMerge (compares left and right pane).

Description: A bit more complex: 7-zip to zip selected folder(s) to the opposite pane, 7-zip to unzip selected zip(s) to the opposite pane, 7-zip: test selected archive(s).

Description: Creates a folder with the same name as the selected file.  A document selected called "project 123.doc" would create a folder named "project 123".

Description: Create new folders in the opposite pane with the same names as selected folders.

Description: Open selected document and a document with the same name in the opposite pane in their associated app (it's awfully lazy, but it can be useful for comparing many documents).

Description: Basically, what I wanted was if Goldwave is invoked with selected files, it would simply open them - however, if no files were selected, it would default to immediately recording instead (saving me the trouble of manually configuring it).

Description: Using '>"C:\Program Files (x86)\GIMP-2.0\bin\gimp-2.6.exe" $S' works fine 99% of the time, whether multiple files are selected or not, which is fine.

Description: The BC one is a little complex (and a little old - but it works - one of these days I'll rewrite it properly.  It's primarily intended for dual-pane use (preserving orientation when BC opens), but could work for single as well. You might need to modify the "const BComp =" (line 12) as needed. Copy the script and save it as Compare_Handler.VBS

Description: All the files from child folders are physically moved to the current folder (as long as there are no duplicates) and all the empty child folders are then deleted.Please exercise caution while executing this script as its action cannot be undone. Test it first on some temp folder with test files before going wild with it.

Description: This is a simple enough utility that does what it says on the tin... in keeping with the Windows and x2 behaviour it is also .HTM/.HTML friendly, in that if you move an .HTML file it will automatically find and move its associated "_files" folder as well (even if it's not selected) - and vice-versa.  All folders are completely overwritten, not merged, as merging things is an unnatural act that never should have been allowed out of the barnyard.

Description: It extracts the compressed file to the opposite pane, using the zip file's basename as the folder to be extracted into.

NOTE #1: If you see any mistakes, broken/wrong links, please PM or post with corrections. More detailed user commands descriptions for already existing ones are also welcomed. All information will be added to the correct spot.

NOTE #2: I have not tested all of these commands/scripts and I can not guarantee they work as intended/expected. While they are posted by trustworthy members and reviewed by other members, always use new scripts/commands with caution first (test on insignificant files), then put to regular use.
Last edited by IneedHelp on 2011 Oct 17, 01:18, edited 5 times in total.
User avatar
Gold Member
Gold Member
Posts: 609
Joined: 2010 Feb 04, 02:15
Location: MeanWhile City

Post by IneedHelp »

And I hate the avatar column... it messed my 1st post...
But not anymore, thanks to fgagnon fixing it.
Last edited by IneedHelp on 2011 Aug 05, 15:53, edited 1 time in total.
User avatar
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

Thanks for getting something like this organized and started.

PS: @ avatar column ... it messed my 1st post -
to assure sufficient width in post I usually make a line of sufficient number of underscores "_" (colored white) somewhere in the post {as I presumptuously added just below your intro, above}, and then I preview the result adding/removing enough of them to assure the readability I want to see in the body of the post (but you probably knew that)  ;)
Post Reply