Hi, I'm trying to create a batch file that will stop the xcopy and
delete batch process and return a "Drive Full" statement, if there is
not enough space on my destination drive. This is what I have so far:
set /p INPUT= Enter PREVIOUS Date (ddmmyyyy) for which you want to create an ARCHIVE folder:
xcopy "i:\*.*" "h:\archive\graphics\%INPUT%" /D /E /R /I /K /-Y || goto Error
echo y | rd /s /q i:\DailyWork
echo y | del i:\Clients.xls
echo The Archive Drive is FULL! STOPPING Backup Procedure.
The batch file does stop, when the backup drive is full, but instead of
showing the error statement about the drive being full, I get a message
that instead states --
"Insufficient disk space on current disk.Insert another disk and type <Return> to continue..."
-- and I have to hit the "X" control button in the upper right of the
batch's pop-up window to close out of and exit the batch file. I've
also tried the following variations, but the batch file ended with the
1) xcopy "i:\*.*" "h:\archive\graphics\%INPUT%" /D /E /R /I /K /-Y || goto :Error (adding the colon before the word Error)
2) xcopy "i:\*.*" "h:\archive\graphics\%INPUT%" /D /E /R /I /K /-Y if %ErrorLevel% GTR 0 goto Error
From what I understand, batch file exit codes go from 0 to 5, and the code
pertaining to insufficient disk space is 4 ... but to be save, I should
have any code greater than 0 stop my xcopy/delete batch.
I would greatly appreciate any help in correcting my coding syntax for this batch file. Thanks so much!
Help, my PC with Windows 10 won't shut down properly
Since upgrading to Windows 10 my computer won't shut down properly. I use the menu button shutdown and the screen goes blank, but the system does not fully shut down. The only way to get it to shut down is to hold the physical power button down till it shuts down. Any suggestions?