Help With Macrium Columns Script

Discuss and share scripts and script files...
Post Reply
Jim-W
Posts: 9
Joined: 28 Aug 2018 09:29

Help With Macrium Columns Script

Post by Jim-W »

`
Macrium Refect has shell integration for Windows Explorer columns.
https://knowledgebase.macrium.com/displ ... rercolumns

I have a working VB script for another file manager (Dopus) and wondering if anyone could convert this into an XYplorer script.

I found the two columns "Backup Method" and "Backup Comment" in XY but they don't work, probably because Macrium is x64 and XY is well... 32-bit :| , and Macrium won't let you install the 32 bit if your Windows is x64.

Any help would be greatly appreciated.

James

Code: Select all

option explicit
' macrium-columns
' 
Function OnInit(initData)
    initData.name = "Macrium"
    initData.version = "1.0"
    initData.default_enable = true
    initData.min_version = "12.0"
    Dim props, prop, col
    Set props = DOpus.FSUtil.GetShellPropertyList("Macrium.*", "r")
    for each prop in props
        Set col = initData.AddColumn
        col.name = prop.raw_name
        col.method = "OnMacriumColumn"
        col.label = prop.display_name
        col.justify = "left"
        col.autogroup = true
        col.userdata = prop.pkey

    next    
End Function

Function OnMacriumColumn(scriptColData)
    scriptColData.value = scriptColData.item.shellprop(scriptColData.userdata)
End Function

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Help With Macrium Columns Script

Post by highend »

But you are aware that this script will only work in a 64-bit instance of dopus and NOT a 32-bit instance of it?...
One of my scripts helped you out? Please donate via Paypal

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Help With Macrium Columns Script

Post by highend »

You can find out the necessary ids for both of the Macrium Reflect columns with this exe:
Enumerate all extended shell properties_x64.zip
(60.53 KiB) Downloaded 130 times
Open a command prompt, switch into the directory you've extracted the .zip into and call the .exe with:

Code: Select all

"Enumerate all extended shell properties_x64.exe" "<full path to one of your .rimrg files>"
Look for the two Macrium columns in the output and write both ids down!
Do this step first!

Add two custom columns by:
Executing:

Code: Select all

snippet;
{ENTER}
from the address bar

and pasting the code below into it.
Do this two times (you need two custom columns...)!

Name the first e.g. "Method" and the second e.g. "Comment"
Replace the $type line for the second custom column
with "comment" instead of "method"
and for both custom columns inside the used scripts the 2 with the column id for "Backup Method" and
the 3 for the column id for "Backup Comment" from the first step.

Code: Select all

      sPropName  = oFolder.GetDetailsOf(Null, 2)
      sPropValue = oFolder.GetDetailsOf(oFile, 2)
      
      sPropName  = oFolder.GetDetailsOf(Null, 3)
      sPropValue = oFolder.GetDetailsOf(oFile, 3)
The real values could look like this (this is OS dependent)!:

Code: Select all

      sPropName  = oFolder.GetDetailsOf(Null, 291)
      sPropValue = oFolder.GetDetailsOf(oFile, 291)
      
      sPropName  = oFolder.GetDetailsOf(Null, 292)
      sPropValue = oFolder.GetDetailsOf(oFile, 292)
After you've finished these steps, go into your %TEMP% folder and delete the
"XY_CC_VBScript.vbs" file!


Use this as a custom column script:

Code: Select all

Snip: CustomColumn 1
  XYplorer 19.20.0036, 29.10.2018 16:51:52
Action
  ConfigureColumn
Caption
  Method
Type
  3
Definition
      $type     = "method"; // Options: "method" / "comment"
      $tmpFile  = "%TEMP%\XY_CC_VBScript.vbs";
      $vbScript = <<<>>>
  On Error Resume Next
  
  sFullPath = WScript.Arguments(0)
  sType     = LCase(WScript.Arguments(1))
  sFile     = Mid(sFullPath, InStrRev(sFullPath, "\") + 1)
  sPath     = Mid(sFullPath, 1, InStrRev(sFullPath, "\") - 1)
  
  Set objShell = CreateObject("Shell.Application")
  Set oFolder  = objShell.Namespace(sPath)
  Set oFile    = oFolder.ParseName(sFile)
  
  If sType = "method" Then
      sPropName  = oFolder.GetDetailsOf(Null, 2)
      sPropValue = oFolder.GetDetailsOf(oFile, 2)
  
      If sPropName <> "" Then
          If sPropValue <> "" Then
              WScript.Echo sPropValue
          End If
      End If
  ElseIf sType = "comment" Then
      sPropName  = oFolder.GetDetailsOf(Null, 3)
      sPropValue = oFolder.GetDetailsOf(oFile, 3)
  
      If sPropName <> "" Then
          If sPropValue <> "" Then
              WScript.Echo sPropValue
          End If
      End If
  End If
  >>>;
  
      writefile($tmpFile, $vbScript, "n", "utf8");
      return replace(runret("""C:\Windows\Sysnative\cscript.exe"" ""$tmpFile"" ""<cc_item>"" ""$type"" //nologo"), <crlf>);
Format
  1
Trigger
  1
Item Type
  0
Item Filter
  *.mrimg
Alternatively, you could use this compiled (x64!) version of a slightly modified .vbs script, that needs to be called with a file and a specific id:
Enumerate extended shell properties_x64.zip
(59.35 KiB) Downloaded 130 times
Then the script itself can be reduced to:

Code: Select all

return replace(runret("""<some path>\Enumerate extended shell properties_x64.exe"" ""<cc_item>"" <id>"), <crlf>);
Where <id> needs to be replaced with the real id, on this vm test machine e.g.:
For "Method"

Code: Select all

return replace(runret("""<some path>\Enumerate extended shell properties_x64.exe"" ""<cc_item>"" 291"), <crlf>);
For "Comment"

Code: Select all

return replace(runret("""<some path>\Enumerate extended shell properties_x64.exe"" ""<cc_item>"" 292"), <crlf>);
One of my scripts helped you out? Please donate via Paypal

Post Reply