Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

Copy the UNC paths of multiple selected files

Description
This script will convert the list of files on the clipboard to UNC paths.
Language
C#.net
Minimum Version
Created By
KarolPiechoczek
Contributors
-
Date Created
Jan 13, 2021
Date Last Modified
Jan 13, 2021

Scripted Function (Macro) Code

using System;
using System.Windows.Forms;
using System.IO;
using System.Collections.Generic;

public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
BFS.Clipboard.Copy();
List<string> files = new List<string>();
foreach (string file in Clipboard.GetFileDropList())
{
files.Add(file);
}

if (files != null || files.Count != 0)
{
string pathToClipboard = String.Empty;
foreach (var item in files)
{
pathToClipboard += Path.GetFullPath(item) + Environment.NewLine;
}
Clipboard.SetText(pathToClipboard.Trim());
}
}
}