2 つの単純なバット ファイルを作成しましたが、両方で同じエラーが発生し続けます。Bat ファイルの内容をテキスト ドキュメントに記録したいと考えていました。エラーは :The process cannot access the file because it is being used by another process.
それは私が自分自身の中でバットファイルと呼ばれているからですか?
コード 1
@echo off
:BEGIN
net stop redmineMongrel1
TIMEOUT /T 15
net start redmineMongrel1
goto SUCCESS
:SUCCESS
"C:\Documents and Settings\Administrator\My Documents\MongrelRestartScript.bat" > "C:\Documents and Settings\Administrator\My Documents\MongrelRestart.log"
ECHO Mongrel Restart Successful %DATE%>> "C:\Documents and Settings\Administrator\My Documents\MongrelRestart.log"
goto END
:FAIL
ECHO.>"C:\Documents and Settings\Administrator\My Documents\MongrelRestart.log"
ECHO Mongrel Restart FAILED %DATE%>> "C:\Documents and Settings\Administrator\My Documents\MongrelRestart.log"
:END
echo END OF BAT FILE
コード 2
@echo off
:BEGIN
DEL "D:\BACKUPS\RedmineFolder" /s /q
RD "D:\BACKUPS\RedmineFolder" /s /q
xcopy C:\BitNami\apps\redmine "D:\BACKUPS\RedmineFolder" /e /h /r /y /I
goto SUCCESS
:SUCCESS
ECHO.>"C:\Documents and Settings\Administrator\My Documents\RedmineBackupLog.log"
ECHO Redmine Backup Successful %DATE%>> "C:\Documents and Settings\Administrator\My Documents\RedmineBackupLog.log"
"C:\Documents and Settings\Administrator\My Documents\RedmineBackUpScript.bat" >> "C:\Documents and Settings\Administrator\My Documents\RedmineBackupLog.log"
goto END
:FAIL
ECHO.>"C:\Documents and Settings\Administrator\My Documents\RedmineBackupLog.log"
ECHO Redmine Backup FAILED %DATE%>> "C:\Documents and Settings\Administrator\My Documents\RedmineBackupLog.log"
:END
echo END OF BAT FILE