When i try to delete an empty folder i got "the dirctoy name is invalid"

Chen Touboul

Hi,

I have a script that run automatically from remote server to another to delete old archive folders.
This script, delete a recursive folder, it runs every night and randomly failed.
The command for delete is rmdir /Q /S "%\\Path\to\the\Source%" (I used TCC of course)

I checked if there is an open process and i didn't find anything.
I also added the unlocker feature to my script and still nothing have been changed.
I tried the del command and its switches, tried purge by Robocopy and.. still randomly failed.

Regards,
Chen

rconn

That error message is coming from Windows, not TCC.

I'm not sure exactly what you're doing with "%\\Path\to\the\Source%" - that isn't a valid variable name (you can't use \ characters). How are you defining that variable?

AnrDaemon

You may define almost any variable name by enclosing entire definition in quotes.
Like
Code:
SET "anything=yy"

Chen Touboul

Hi Rconn and AnrDeamon, sorry for the late response.

Leave the variable, it is just an example for a variable that contains a specific path.

Replies
3
Views
4K
Replies
4
Views
2K
Replies
1
Views
1K
Replies
20
Views
4K
Replies
0
Views
222
Replies
2
Views
986
Replies
2
Views
989
Replies
5
Views
1K
Replies
10
Views
2K
Replies
11
Views
3K
Replies
6
Views
2K
Replies
18
Views
2K
Replies
3
Views
1K
Replies
8
Views
1K
Replies
1
Views
1K
Replies
3
Views
1K
Replies
7
Views
1K
Replies
7
Views
1K
Replies
6
Views
5K
Replies
4
Views
2K
Replies
5
Views
1K
Replies
2
Views
1K
Replies
21
Views
3K
Replies
8
Views
3K
Replies
8
Views
5K
Replies
46
Views
9K
Replies
12
Views
4K
Replies
4
Views
2K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
9
Views
1K
Replies
4
Views
1K
Replies
5
Views
1K
Replies
5
Views
1K
Replies
1
Views
1K
Replies
0
Views
770
Replies
2
Views
1K
Replies
19
Views
3K
Replies
21
Views
10K
Replies
6
Views
2K
Replies
22
Views
3K
Replies
10
Views
2K
Replies
1
Views
2K
Replies
0
Views
1K
Replies
7
Views
3K
Replies
11
Views
5K
Replies
5
Views
5K