
cls&echo off&cd /d "%~dp0"&set "current=%cd%"
rem 读取剪贴板内容作为名字,在指定目录里新建一个文件夹并且打开该文件夹
set #=Any questions&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
set "specifiedpath=C:\xxx\指定目录"
powershell -NoProfile -ExecutionPolicy bypass "Get-Content -literal '%~f0'|Out-String|Invoke-Expression"
echo%#% +%$%%$%/%_% %z%
pause
exit
#>
$specifiedpath=($env:specifiedpath).trimend('\')
Add-Type -AssemblyName System.Windows.Forms$name=''
if([Windows.Forms.Clipboard]::ContainsText()){
$name=[Windows.Forms.Clipboard]::GetText() -split '[\r\n]'
$newfolder=$specifiedpath+'\'+$name[0].trim()
if(-not (test-path -literal $newfolder)){
try{
[void][IO.Directory]::CreateDirectory($newfolder)
}catch{write-host 'Illegal characters'}
}
Start-Process explorer.exe $newfolder
}else{wrrite-host 'No text'}
1、首先,在桌面上击右键,选择“新建-文本文档”菜单选项。
2、打开文本文档页面之后,输入批处理文件的代码,然后保存。
3、接下来,将保存之后的文本文档后缀名修改为.bat,然后保存文件,这一点非常重要的
4、最后,双击该文件即可运行BAT批处理程序,按照页面信息提示运行即可。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)