是否有人知道我需要使用批处理文件将一个文件替换为另一个文件的脚本。
答案 0 :(得分:0)
我刚才写过这篇文章,我们用它来更新我们的Access数据库推出。
rem -- Set up the variables here.
rem -- HDIR = Home Directory on local hard drive
rem -- PDIR = Location of Production version of database
rem -- PName = Name of database
Set HDIR=C:\Cigna\PIT
Set PDIR=\\Server051\Projects\Reporting\IntakeTool
Set PName=Intake_Tool.mdb
rem -- DO NOT EDIT ANYTHING BELOW THIS LINE --
rem -- If the directory exists on the local hard drive, don't bother creating it
if exist "%HDIR%" GoTo DirDone
md "%HDIR%"
:DirDone
rem -- Create a temp mapping since BAT files can't deal with UNCs
pushd %PDIR%
rem -- Copy the database and icon to the local hard drive, and the link to the desktop
Copy %PName% %HDIR%
答案 1 :(得分:0)
答案 2 :(得分:0)
您可以使用xcopy将内容从一个目录复制到另一个目录
XCopy / U D:\ prac \ a \ 1.txt D:\ prac \ b
您可以访问链接
中的其他选项