thighighlighting文本要复制主题名称。
右键单击我所在的任何目录并创建一个新文件夹。命名新文件夹。
mkdir
对于新文件夹 我相信
%clipboard%
对于剪贴板
%cd%
对于当前目录。
有第三方免费的工具可以读取剪贴板 - 但是,我知道的任何方式都不会公开Explorer窗口中的当前目录 - 这意味着您无法在探险家窗口中操作它的同一地点编程地创建一个文件夹。
但是,您可以使用免费的
autohotkey
来按键,单击并从简单的热键中复制到剪贴板,粘贴等。
对于上下文菜单集成,可能是superuser.com是一个更好的地方对于剪贴板的文件夹创建
使用JavaScript代码使用
mshta.exe
(即Windows的一部分)从剪贴板检索数据。
我还在寻找类似的东西,但找不到对我有用的东西。尝试了
:: Where to create the folder should come from contextual menu as parameter
if "%~1"=="" exit /b 1
if not exist "%~1" exit /b
我提出了我自己问题的部分解决方案,这可能会对任何寻求答案但有几个警告的人有帮助:
它不是纯批次脚本。这是批次/powershell混合动力车。
它在每次运行中简要打开一个窗口。它创建了一个临时文件,我希望将来删除它,因为我慢慢了解有关PowerShell的更多信息,并在操作后删除它。 它将在剪贴板中每行创建一个文件夹。
CB2Folder.bat
:
@echo off
cd /d "%~1" >nul 2>&1
setlocal enabledelayedexpansion
:: Save the clipboard content into a temporary file
for /f "delims=" %%a in ('powershell -sta "add-type -as System.Windows.Forms; [windows.forms.clipboard]::GetText()"') do echo %%a >> temp_clipboard.txt
:: Loop through the file and create a folder for each line (splitted by newlines)
for /f "delims=" %%b in (temp_clipboard.txt) do (
if not "%%b"=="" (
echo Creating folder: %%b
mkdir "%%b"
)
)
:: Clean up the temporary file
del temp_clipboard.txt
要添加到文件夹的上下文菜单(将创建所选文件夹中的文件夹)和shell(将在当前文件夹中创建文件夹),将批处理脚本移至C:\Scripts\
CB2Folder.bat