Цитата kuzmakzrezv1:
NewName - у меня переименование »
|
Оригинально. Для меня NewName — создание

.
Примерно так:
C:\Мои проекты\0236\ReNameByClipboard.vbs
Код:

Option Explicit
Dim strSourceObject
Dim strSourceFolder
Dim strSourceFile
Dim strClipboardContent
Dim strDestObject
If WScript.Arguments.Count = 1 Then
With WScript.CreateObject("Scripting.FileSystemObject")
strSourceObject = .GetAbsolutePathName(WScript.Arguments.Item(0))
If .FolderExists(strSourceObject) Then
strSourceFolder = strSourceObject
strClipboardContent = Trim(WScript.CreateObject("htmlfile").parentWindow.clipboardData.getData("text"))
strDestObject = Trim(InputBox("Enter new name for folder [" & strSourceFolder & "]:", "Enter new name for folder", strClipboardContent))
If Len(strDestObject) > 0 Then
If Not StrComp(strSourceFolder, strDestObject, vbTextCompare) = 0 Then
.MoveFolder strSourceFolder, strDestObject
Else
WScript.Echo "Need new name of folder."
WScript.Quit 4
End If
Else
WScript.Echo "User cancel input."
WScript.Quit 3
End If
ElseIf .FileExists(strSourceObject) Then
strSourceFile = strSourceObject
strClipboardContent = Trim(WScript.CreateObject("htmlfile").parentWindow.clipboardData.getData("text"))
strDestObject = Trim(InputBox("Enter new name for file [" & strSourceFile & "]:", "Enter new name for file", strClipboardContent))
If Len(strDestObject) > 0 Then
If Not StrComp(strSourceFile, strDestObject, vbTextCompare) = 0 Then
.MoveFile strSourceFile, strDestObject
Else
WScript.Echo "Need new name of file."
WScript.Quit 4
End If
Else
WScript.Echo "User cancel input."
WScript.Quit 3
End If
Else
WScript.Echo "Can't find source file system object [" & WScript.Arguments.Item(0) & "]."
WScript.Quit 2
End If
End With
Else
WScript.Echo "Usage: wscript.exe """ & WScript.ScriptName & """ <Source file system object>"
WScript.Quit 1
End If
WScript.Quit 0
ReNameByClipboard.reg
Код:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\ReNameByClipboard]
@="Переименовать из Бу&фера обмена"
[HKEY_CLASSES_ROOT\*\shell\ReNameByClipboard\command]
@="wscript.exe \"C:\\Мои проекты\\0236\\ReNameByClipboard.vbs\" \"%1\""
[HKEY_CLASSES_ROOT\Directory\shell\ReNameByClipboard]
@="Переименовать из Бу&фера обмена"
[HKEY_CLASSES_ROOT\Directory\shell\ReNameByClipboard\command]
@="wscript.exe \"C:\\Мои проекты\\0236\\ReNameByClipboard.vbs\" \"%1\""
Путь к файлу скрипта в файле реестра Вы, естественно, указываете свой.