Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

A recent AVG and Avast antivirus update is preventing DisplayFusion 9.9 from launching on some systems.
If you're running into this issue, please update to the latest DisplayFusion 10.0 Beta.

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());
}
}
}