蝙蝠错误"参数&QUOT无效号码; [英] Bat Error "invalid number of parameters"

查看:414
本文介绍了蝙蝠错误"参数&QUOT无效号码;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想一个bat文件写入到备份的文件夹我的工作的服务器上(有时服务器和备份服务器不正确同步和文件失踪)。

I am trying to write a bat file to backup a folder on my work server (sometimes the server and backup server do not sync correctly and files go missing).

我已经尝试了许多不同的解决方案,并宣读了几个不同的论坛,试图解决这个问题,但我似乎无法找到任何东西。
<罢工>

I have tried many different solutions and read a few different forums to try to resolve this, but I cannot seem to find anything.

@echo This will now create a new backup of S:\Internal Auditor\9 - September 14

@echo off

:: variables
set SRCFOLDER="S:\Internal Auditor\9 - September 14"
set DESTFOLDER="S:\Internal Auditor\2014\9 - Sept Backup"
set folder=%date:~5,2%-%date:~8,2%-%date:~0,4%
set backupcmd=xcopy /W /E /H /V /C /Z /I /F /J /R /Y

echo ######## PLEASE WAIT SYSTEM BACKINGUP SOME DATA########
xcopy %SRCFOLDER% %DESTFOLDER% %backupcmd%

echo !!!!!!!!BACKUP COMPLETED THANKS!!!!!!!!!!!!!!
@pause


请帮助 - 我已经厌倦了失去的文件,我不想每天都必须手动备份文件

Please help - I'm tired of losing files, and I don't want to have to manually backup files every day.

(目标是创建日期和放一个新的文件夹中;每次子文件夹下运行时的时间9 - 9月14日{历史备份})。

(The goal is the create a new folder with date & time every time it runs under the sub-folder "9 - September 14"{historical backup}).

修改
好了 - 所以,我有另一个线程开放的东西不一样,但现在我的2个问题都还挺合并在一起,因此,请看看@的每个备份CMD 新建文件夹,看看你能不能帮...

EDIT Ok - So I have another thread open for something that was different, but now my 2 questions have kinda merged together, so please look @ New folder for every backup CMD and see if you could help...

推荐答案

使用设置backupcmd = / W / E / H / V / C / Z / I / F / J / R / Y

而不是设置backupcmd = XCOPY / W / E / H / V / C / Z / I / F / J / R / Y 。你有多余的参数XCOPY。

instead of set backupcmd=xcopy /W /E /H /V /C /Z /I /F /J /R /Y . You have redundant xcopy in parameters.

修改至于我明白你的意见,你需要这样一个新的文件夹S:\\内审员\\%日期:5,2〜% - %日期:8.2〜% - %日期:0,4〜%

EDIT. As far as I understood your comments you need a new folder like this "S:\Internal Auditor\%date:~5,2%-%date:~8,2%-%date:~0,4%"

所以你可以这样做:

set SRCFOLDER="S:\Internal Auditor"
set "DESTFOLDER="S:\Internal Auditor\2014"
set "folder=%date:~5,2%-%date:~8,2%-%date:~0,4%"
md "%DESTFOLDER%\%folder%" >nul 2>&1
set "backupcmd=/W /E /H /V /C /Z /I /F /J /R /Y"
echo ######## PLEASE WAIT SYSTEM BACKINGUP SOME DATA########
xcopy "%SRCFOLDER%\%folder%" "%DESTFOLDER%\%folder%" %backupcmd%

echo !!!!!!!!BACKUP COMPLETED THANKS!!!!!!!!!!!!!!

这篇关于蝙蝠错误&QUOT;参数&QUOT无效号码;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆