Problems deleting a folder

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
thrice910
Posts: 1
Joined: 23 Aug 2010 07:46

Problems deleting a folder

#1 Post by thrice910 » 23 Aug 2010 07:56

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

amel27
Expert
Posts: 177
Joined: 04 Jun 2010 20:05
Location: Russia

Re: Problems deleting a folder

#2 Post by amel27 » 25 Sep 2010 22:53

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...

Post Reply