windows - 创建批处理文件以备份数据,并创建一个新目录以在每次运行时复制到
问题描述
我需要每次从同一个位置备份数据,但每次都备份到新创建的目录。我已经完成了创建新目录的部分,但是一旦创建了新目录,如何将数据复制到新目录?
这是我到目前为止所拥有的:
@echo off
set counter=0
mkdir "c:\bginfo\dantest" 2>nul || goto :TryNext
:continue
rest of your code
goto :eof
:TryNext
set /a counter+=1
mkdir "c:\bginfo\dantest (%counter%)" 2>nul || goto :TryNext
goto :continue
假设数据在C:\Program\Data
,我会做这样的事情吗:
copy c:\program\data\*.* c:\bginfo\dantest (%counter%)
我不确定如何对新创建的位置进行编码。
解决方案
推荐阅读
- go - 解析字符串返回月份超出范围错误
- php - PHP 并不总是从 $_GET 中获得价值
- html - 使用引导程序时使用 css 更改字体颜色?
- c - 库中的链接器脚本变量阻止动态链接
- javascript - 登录后无法从 React.js 获取 Passport.js req.user
- html - 如何在 React 中使particle.js 全屏显示?
- android - 无法在具有 targetSdk 29 的应用程序中获取 ContentResolver.openInputStream(Uri uri) 并在具有 API 29 的设备上获取 compileSdk 29
- python - Pandas 数据框从 as_matrix 移动到 to_numpy
- reactjs - 深度嵌套 API 打印
- c# - 如何知道 URL 来自浏览器的地址栏或 ajax 调用?