rem 从当前目录里的以当天日期命名的文件夹下搜索出xml文件,并复制到同一个新的目录里
set #=Any question&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
>"%tmp%\v.v" echoWSH.echo right(Year(date),4) ^& "-" ^& right("0" ^& Month(date),2) ^& "-" ^& right("0" ^& Day(date),2)
for /f %%a in ('cscript -nologo -e:vbscript "%tmp%\v.v"') do set todayfolder=%%a
if not exist "%todayfolder%" (echo"%todayfolder%" path error or not exist&pause&exit)
for /f "delims=" %%a in ('dir /a-d-h/b/s "%todayfolder%\*.xml"') do (
echo"%%a" --^> "统一路径"
)
echo%#% +%$%%$%/%_% %z%
pause
exit
不清楚你的实际文件/情况,仅以问题中的说明及猜测为据;以下代码复制粘贴到记事本,另存为xx.bat,编码选ANSI<# :cls&echo off&cd /d "%~dp0"&mode con lines=5000
rem 将一个指定目录下的当天文件拷贝/复制到网络驱动器的指定目录下
set #=Any question&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
set "oldfolder=D:\xxx\指定文件夹"
set "newfolder=\\网络主机ip\共享文件夹"
if not exist "%oldfolder%" (echo"%oldfolder%" not found&pause&exit)
powershell -NoProfile -ExecutionPolicy bypass "Get-Content -literal '%~f0'|Out-String|Invoke-Expression"
echo%#% +%$%%$%/%_% %z%
pause
exit
#>
$b=[Convert]::FromBase64String("IC0tPiA=")
$c=[Text.Encoding]::Default.GetString($b)
$today=(get-date).ToString('yyyy-MM-dd')
$oldfolder=$env:oldfolder$newfolder=$env:newfolder
$files=@(dir -literal $oldfolder -recurse|?{$_ -is [System.IO.FileInfo]})
for($i=0$i -lt $files.length$i++){
$wd=$files[$i].LastWriteTime.ToString('yyyy-MM-dd')
if($wd -eq $today){'['+$wd+']'+$files[$i].FullName+$c+$newfolder}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)