We are in the process of migrating this forum. A new space will be available soon. We are sorry for the inconvenience.

Delete Older Folder in CIFS folder


inevco
2015-11-19, 03:02 PM
Hi all,

I need to delete older folder (only one folder), on my OCV CIFS folder. This folder is my external 200GB backup on my OVH Server.

I found and tested this .bat files on my own computer. And it works perfectly.

----------
cd C:\test

set dossier=
for /f "delims=" %%a in ('dir /a:d /o:d /b .') do (
set dossier=%%a
goto fin
)
:fin
if not "%dossier%" == "" rmdir /s/q "%dossier%"
----------

I created a text file and save it in .bat file. When I run this file, older folder from c:\test is deleted.

I copy this file on my OVH server, create a "test" folder on C:\, created 5 folders on C:\test\ and run the script.

Everything work perfectly. Each time that I run this .bat file, older folder is delete.

Now, I need to replace "cd C:\test" by "cd O:\test".

O: is my CIFS backup drive. (200GB).

Even if I run my .bat file normally or as an Administrator, folder is not deleted.

Someone can help ?

Thanks !!