Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Single Post  Topic: Копирование имени без слеша 
Author Message
Batya



PostPosted: Tue Oct 11, 2011 17:37    Post subject: Reply with quote

Flasher wrote:
Чтобы при постановке на [..] копировался путь к рабочему каталогу. Типа фича.

Прикольно.

Вариант на основе скрипта от Flasher:
Code:
'=========================================
' Копировать имена выделенных папок/файлов
' Параметр: {%L|%l|%F|%f|%D|%d}
'=========================================
If WScript.Arguments.Count = 0 Then Wscript.Quit
Dim T
T = Replace(CreateObject("Scripting.FileSystemObject").OpenTextFile(WScript.Arguments(0), 1).ReadAll, "\" + chr(13), chr(13))
Text2Clip Mid(T, 1, Len(T) - 2)

Sub Text2Clip(pText)
  Dim TCS
  On Error Resume Next
  Set TCS = CreateObject("TCScript.Helper")
  If Err.Number > 0 Then
    Dim A
    On Error GoTo 0
    Const P = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\1407"
    With CreateObject("WScript.Shell")
      A = .RegRead(P)
      If A > 0 Then .RegWrite P, 0, "REG_DWORD"
      With CreateObject("InternetExplorer.Application")
        .Navigate("about:blank")
        .document.ParentWindow.ClipboardData.SetData("text"), pText
      End With
      If A > 0 Then .RegWrite P, A, "REG_DWORD"
    End With
  Else
    On Error GoTo 0
    TCS.SetTextToClip(pText)
  End If
End Sub

_________________
Нет, я не сплю. Я просто медленно моргаю.


Last edited by Batya on Wed Oct 12, 2011 16:02; edited 3 times in total
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group