Create REG file to define XYplorer as default file manager
Posted: 13 Jan 2009 22:03
This script creates two REG files pointing to the current XYplorer.exe. You can use the REG files to (un)make it the default file manager for drives and directories.
Needs XYplorer v7.90.0051 or later.
Note that the script is still good for v8.40 and later.
Usage
NOTE: Changing the registry is potentially dangerous. You have been warned.
(1) Start XYplorer.
(2) Browse to some folder where you want to create two *.reg files.
(3) Open menu Scripting / Try Script...
(4) Paste the script below into the Edit box and press OK
(5) Now you see a "Stepping through a script" dialog. Press Continue (about 8 times) until the script is competed and the dialog closes for good.
(6) You now should see two new *.reg files in the current folder: xyfm-reg.reg and xyfm-unreg.reg
(7) Double-Click xyfm-reg.reg to make XYplorer the default file manager for drives and directories.
To go back to Explorer as default file manager double-Click xyfm-unreg.reg.
Needs XYplorer v7.90.0051 or later.
Note that the script is still good for v8.40 and later.
Usage
NOTE: Changing the registry is potentially dangerous. You have been warned.
(1) Start XYplorer.
(2) Browse to some folder where you want to create two *.reg files.
(3) Open menu Scripting / Try Script...
(4) Paste the script below into the Edit box and press OK
(5) Now you see a "Stepping through a script" dialog. Press Continue (about 8 times) until the script is competed and the dialog closes for good.
(6) You now should see two new *.reg files in the current folder: xyfm-reg.reg and xyfm-unreg.reg
(7) Double-Click xyfm-reg.reg to make XYplorer the default file manager for drives and directories.
To go back to Explorer as default file manager double-Click xyfm-unreg.reg.
Code: Select all
"Create REG files"
// create REG file to define XYplorer as default file manager
// note: "REGEDIT4" is compatible with Win98 and WinNT4
// later OSs can use "Windows Registry Editor Version 5.00" instead
$reg = <<<DOC
REGEDIT4
[HKEY_CLASSES_ROOT\Drive\shell]
@="XYplorer"
[HKEY_CLASSES_ROOT\Drive\shell\XYplorer]
@="Open in XYplorer"
[HKEY_CLASSES_ROOT\Drive\shell\XYplorer\command]
@="\"{xy}\" %1"
[HKEY_CLASSES_ROOT\Directory\shell]
@="XYplorer"
[HKEY_CLASSES_ROOT\Directory\shell\XYplorer]
@="Open in XYplorer"
[HKEY_CLASSES_ROOT\Directory\shell\XYplorer\command]
@="\"{xy}\" %1"
DOC;
// escape the slashes, and insert
replace $xy, "<xypath>\<xyexe>", "\", "\\";
replace $reg, $reg, "{xy}", $xy;
// save file to current path
writefile("xyfm-reg.reg", $reg);
// create REG file to restore Explorer as default file manager
$unreg = <<<DOC
REGEDIT4
[HKEY_CLASSES_ROOT\Drive\shell]
@="none"
[-HKEY_CLASSES_ROOT\Drive\shell\XYplorer]
[HKEY_CLASSES_ROOT\Directory\shell]
@="none"
[-HKEY_CLASSES_ROOT\Directory\shell\XYplorer]
DOC;
// save file to current path
writefile("xyfm-unreg.reg", $unreg);