Processing Ajax...
Save 25% on our desktop apps during our Black Friday/Cyber Monday sale!Save 25% on our desktop apps during our Black Friday/Cyber Monday sale, including DisplayFusion, ClipboardFusion, FileSeek, LogFusion, TrayStatus, and VoiceBot!Save 25% on our desktop apps during our Black Friday/Cyber Monday sale!

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

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