Xshell Extra Files

A VB script to read the first line of a file into system clipboard

Last post: Thursday, February 25, 2016 4:56 AM by Netsarang

Thursday, February 25, 2016 4:56 AM - Netsarang

A VB script to read the first line of a file into system clipboard

 
Sub Main()
Dim objFile, File, line
Dim objClip

'Read File
Set objFile = CreateObject("Scripting.FileSystemObject")
Set File = objFile.OpenTextFile("\your_path\your_file.vbs", 1)
line = File.Readline
File.Close

'Save ClipBoard
set objClip = CreateObject("htmlfile")
objClip.parentWindow.clipboardData.SetData "text", line

xsh.dialog.msgbox("'"&line&"' copied to the system clipboard")
End Sub

Program Ver. :