To clarify: Should I then use the env variable, %comspec% /c, instead of explicitly calling cmd.com?

NTDOC, It appears that I can't delete subdirectories with your CD suggestion due to a share violation.

Code:
 debug on
IF @UserID = Techwall OR Wordp OR Homework
DEL 'c:\tempdrive\*' /h /s
CD c:\tempdrive\
SHELL "%comspec% /C RD c:\tempdrive\"
ENDIF
EXIT


Quote:

The process cannot access the file because it is being used by another process.





SeaLeopard: I just implemented your CleanDirectory.UDF and it works great. Thanks for the lead.

FINAL CODE: Code:
 
call "@ScriptDir\UDF\cleandirectory.udf"
call "@ScriptDir\UDF\DateMath.udf"
call "@ScriptDir\UDF\FULLFILE.udf"
IF @UserID = "Techwall" OR @UserID = "Wordp" OR @UserID = "Homework"
DEL 'c:\tempdrive\*' /h /s
$rc=cleandirectory('c:\tempdrive','*')
ENDIF
EXIT



Edited by StarwarsKid (2005-10-04 07:12 PM)