X² USER COMMANDS REPOSITORY

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
IneedHelp
Gold Member
Gold Member
Posts: 612
Joined: 2010 Feb 04, 02:15
Location: MeanWhile City

X² USER COMMANDS REPOSITORY

Post by IneedHelp »

PLEASE POST ANY USEFUL/UNIQUE USER COMMANDS YOU MAY HAVE
AND GIVE A BRIEF OR DETAILED DESCRIPTION ABOUT WHAT THEY DO.
ALL USER COMMANDS WILL BE SORTED AND ADDED TO THIS FIRST POST.
IT MAY INVOLVE ANY APPLICATION AND IT MAY HAVE ANY UTILITY!

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
exit
:nocontent
"C:\Program Files (x86)\GoldWave\GoldWave.exe" /nosplash -new -record
exit

__________________________________________________
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"
%1
%2

__________________________________________________
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
next

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"
        wscript.quit
     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)"
        wscript.quit
     end if

     if (matchRight) then                                                           ' Swap to preserve Left/Right
        oCompare Wscript.Arguments(4), Wscript.Arguments(2)
     else
        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
  'else
     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.
UC#0003:

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.
UC#0004:

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

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

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..
UC#0007:

Description: Stats with WinDirStat.
UC#0008:

Description: WinMerge (compares left and right pane).
UC#0009:

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).
UC#0010:

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".
UC#0011:

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

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).
UC#0013:

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).
UC#0014:

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.
UC#0015:

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
UC#0016:

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.
UC#0017:

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.
UC#0018:

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

Image
__________________________________________________________________
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
IneedHelp
Gold Member
Gold Member
Posts: 612
Joined: 2010 Feb 04, 02:15
Location: MeanWhile City

Post by IneedHelp »

[RESERVED SPACE]
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
fgagnon
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.
:thumbup:  

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