不清楚你的实际文件/情况,仅以问题中的样例说明及猜测为据;以下代码复制粘贴到记事本,另存为xx.bat,编码选ANSI/GB2312<# :
cls&echo off&cd /d "%~dp0"&set "current=%cd%"
rem 读取剪贴板文字内容作为名字,在一个指定目录里以当天日期命名的文件夹里新建一个文件夹,之后在这个新建好的文件夹里面再新建一个指定名称的文件夹
set #=Any questions&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
powershell -NoProfile -ExecutionPolicy bypass "Get-Content -literal '%~f0'|Out-String|Invoke-Expression"
echo;%#% +%$%%$%/%_% %z%
pause
exit
#>
$newfolder="T:\<1>\<2>\jpg";
$today=(get-date).toString('MM-dd-yyyy');
$newfolder=$newfolder.replace('<1>', $today);
Add-Type -AssemblyName System.Windows.Forms;$name=@();
if([Windows.Forms.Clipboard]::ContainsText()){
$name=[Windows.Forms.Clipboard]::GetText() -split '[\r\n]';
$newfolder=$newfolder.replace('<2>', $name[0].trim());
if(-not [IO.Directory]::Exists($newfolder)){
try{
[void][IO.Directory]::CreateDirectory($newfolder);
}catch{
write-host $newfolder;
write-host $error[0].exception.message -ForegroundColor red;
}
}
if([IO.Directory]::Exists($newfolder)){Start-Process explorer.exe $newfolder;}
}else{wrrite-host 'No text';}
追问可以帮我把新建jpg文件夹的命令去掉吗
本回答被提问者采纳