1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ファイル名をコピー

Last updated at Posted at 2016-10-25

ファイル名をコピー

以下のスクリプトを保存して
sendToにショートカットをおいておく

copyfilename.vbs
Option Explicit

Dim tmp
Dim tmpPath
Dim Args
Set Args = CreateObject("System.Collections.ArrayList")

IF WScript.Arguments.Count > 0 Then
	For Each tmp In WScript.Arguments
		tmpPath = Split(tmp, "\")
		Args.Add tmpPath(Ubound(tmpPath))
	Next
	Call PutInClipboardText( Args.ToArray() )
End If


Public Sub PutInClipboardText(ByVal arr)
	Dim cmd
	Dim str
	Dim WSH
	str = Join(arr, "\n")
	cmd = "mshta.exe ""javascript:clipboardData.setData('text', '" & str & "');close()"""
	Set WSH = CreateObject("WScript.Shell")
	Call WSH.Run("%ComSpec% /c " & cmd, 0, false)
End Sub
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?