Hello I am trying to write a batch file to backup a series of files, delete the folders, then re-create the folders. This is being ran on a industrial machine(using WIN95) to update files.
Everything works except the c:\las_sys\prg\subpro folder.
the programs do no delete out of the folder.
I am thinking that the program running in the background is holding those folders from being deleted? (They are not read only or locked)
How does the code look?
mkdir /Y D:\backupbatch\cnd
mkdir /Y D:\backupbatch\prg
XCOPY /E /Y /I "c:\Las_sys\ncsys\cnd" "D:\backupbatch\cnd"
XCOPY /E /Y /I "c:\Las_sys\ncsys\prg" "D:\backupbatch\prg"
DEL /S "c:\las_sys\ncsys\prg\subpro\*.nc"
DEL /S "c:\las_sys\ncsys\prg\subpro\*.ncp"
RMDIR /S /Q "c:\Las_sys\ncsys\prg\"
RMDIR /S /Q "c:\Las_sys\ncsys\cnd\"
Pause
mkdir c:\Las_sys\ncsys\prg\MitsDoNotTouch
mkdir c:\Las_sys\ncsys\prg\Consumables
mkdir c:\Las_sys\ncsys\prg\VariablePrograms
mkdir c:\Las_sys\ncsys\prg\Subpro
mkdir c:\Las_sys\ncsys\prg\Main
mkdir c:\Las_sys\ncsys\cnd\US5
mkdir c:\Las_sys\ncsys\cnd\US7
mkdir c:\Las_sys\ncsys\cnd\Pierce
mkdir c:\Las_sys\ncsys\cnd\CND
mkdir c:\Las_sys\ncsys\cnd\Jet
XCOPY "a:\40 CFX-CFR Golden Disk\cnd" "c:\Las_sys\ncsys\cnd" /E /Y /I
XCOPY "a:\40 CFX-CFR Golden Disk\prg" "c:\Las_sys\ncsys\prg" /E /Y /I
Problems deleting a folder
Moderator: DosItHelp
Re: Problems deleting a folder
thrice910 wrote:I am thinking that the program running in the background is holding those folders from being deleted?
it is most likely... if you use RD, command "DEL /S" not required
if files in use at the time of RD, proper error message occured...