I use a VBS script to load files and folders to "everything64.exe -rename" from Windows context menus.
But this somewhat stopped working with version v1.5.1341, although it still works perfectly from the EV interface.
When I say stopped working I mean that when changing text in the the Edit3 input text control, filenames are
not instantly changed within the Edit4 textbox control. But in the previous version (v1.5.1340) it still works.
This is an example of the command sent to EV (within the VBS script) to start rename:
Code: Select all
$ everthing64.exe -rename "file 1.ext" "file 2.ext" "file 2.ext" "folder 1" "folder 2"
Code: Select all
'+===============================================
'| EVContextRename
'| Date 2019-10-28 22:35
'| Last 2023-04-10 08:53
'| Author Melvin D. Nava <mdnava[at]gmail.com>
'| URL https://www.mdnava.com/
'+===============================================
'| Rename files/folders from context menus
'|
'| Important: There is a maximum of 32767 chars for command-line arguments (8192 if using cmd.exe).
'| Ref: https://devblogs.microsoft.com/oldnewthing/20031210-00/?p=41553
'|
'| Requires:
'| <everything.exe> https://www.voidtools.com/
'| <singleinstance.exe> https://github.com/ge9/SingleInstance-Launcher
'|
'| Usage (in the Windows Registry):
'| $ singleinstance.exe \"%1\" \"D:\\path\\to\\EVContextRename.vbs\" $files --si-timeout 400"
'+============
Option Explicit
If WScript.Arguments.Count < 1 Then MsgBox "Missing parameter, nothing to do!.", vbInformation, "Notice" & WScript.Quit()
Dim objFSO, objShell, envDesktopPath, arrArgs
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set arrArgs = Wscript.Arguments
EVContextRename()
' ===========================
' == Main Subroutine ========
' ===========================
Public Sub EVContextRename()
Dim sScriptFolder, sArg, sVar
Dim nSubFolderCount, nFileCount, nTotalCount
sScriptFolder = objFSO.GetParentFolderName(objFSO.GetFile(Wscript.ScriptFullName))
nSubFolderCount = 0
nFileCount = 0
nTotalCount = 0
'** If argument is a single folder, get all its files (but no subfolders)..
If objFSO.FolderExists(arrArgs(0)) And WScript.Arguments.Count = 1 Then
Dim objFolder, objSubFolders, objFolderFiles, pFolderPath, f
Set objFolder = objFSO.GetFolder(arrArgs(0))
Set objSubFolders = objFolder.SubFolders
Set objFolderFiles = objFolder.Files
pFolderPath = objFSO.GetAbsolutePathName(objFolder)
nSubFolderCount = objSubFolders.Count
nFileCount = objFolderFiles.Count
nTotalCount = nSubFolderCount + nFileCount
objShell.CurrentDirectory = pFolderPath
For Each f in objFolderFiles '** Add files from folder
sVar = sVar & " """ & objFSO.GetAbsolutePathName(f.Name) & """"
Next
If sVar = "" Then '** If there are no files, try to add subfolders
For Each f in objSubFolders '** Add subfolders from folder
sVar = sVar & " """ & objFSO.GetAbsolutePathName(f.Name) & """"
Next
End If
Else '** Handle any selected files or folders (sent as arguments)
For Each sArg In arrArgs
If objFSO.FileExists(sArg) Or objFSO.FolderExists(sArg) Then
sVar = Replace(sVar, "file:///", "") '** For CopyQ
sVar = Replace(sVar, "file://", "")
sVar = sVar & " """ & sArg & """"
nFileCount = nFileCount + 1
End If
Next
End If
sVar = Trim(sVar)
If sVar = "" Then WScript.Quit
If Len(sVar) > 32750 Then ' Stop at a bit less chars than allowed
WScript.Echo "There are too many arguments, try selecting less elements: " & vbCrLf & vbCrLf & _
Len(sVar) & " characters (limit: 32750)" & vbCrLf & _
nFileCount & " files" & vbCrLf
'nSubFolderCount & " folders" & vbCrLf
WScript.Quit
End If
objShell.Run sScriptFolder & "\Everything64.exe -rename " & sVar, 1, False
End Sub
Set objFSO = Nothing
Set objShell = Nothing
Code: Select all
; ============================================
; AutoHotkey
; Everyting Rename on File Explorer [CTRL+R]
; ============================================
#If IsAnyFileExplorer() And Not Winactive("ahk_exe Everything64.exe") ; EV already has CTRL+R set up
^R::
EverythingRename() {
Local sSelectedFiles := GetSelectedFiles()
If (sSelectedFiles = "")
sSelectedFiles := """" . GetCurrentPath() . """"
If (sSelectedFiles != "") And (sSelectedFiles != "ERROR")
Run(EnvGet("EVERYTHING_HOME") . "\EVContextRename.vbs " . sSelectedFiles)
Return
}
#If