Dear

We had some remarks:


  • when the %temp% isn't defined it is possible that the wrong
    files will be deleted. First check: does mine %temp% variable exist.
    Secondly check: do the directory exist.
  • with a del you are only deleting files in specified
    directory. Subdirectories and files in subdirectories will not
    be deleted.
    A better suggestion is: use deltree command, which can
    handle also open files. Other commands will stop processing
    your command.


    We suggest to modify it to:

    code:

    IF (len("%temp%") <> 0)
    IF (Exist("%temp%\nul") = 1)
    run '%comspec% /c echo Y|del %temp%'
    ENDIF
    ENDIF

    a better suggestion is:

    code:

    IF (len("%temp%") <> 0)
    IF (Exist("%temp%\nul") = 1)
    run '%comspec% /c deltree /y %temp%\.'
    ENDIF
    ENDIF

    a last suggestion is:

    code:

    IF (Exist("c:\winnt\temp\nul") = 1)
    run '%comspec% /c deltree /y c:\winnt\temp\.'
    ENDIF
    IF (Exist("c:\windows\temp\nul") = 1)
    run '%comspec% /c deltree /y c:\windows\temp\.'
    ENDIF
    IF (Exist("c:\temp\nul") = 1)
    run '%comspec% /c deltree /y c:\temp\.'
    ENDIF


    Only files and subdirectories in specified directories will be deleted.
    The names aren't influenced by other settings and you know that the
    specified directories can do any harm by deletion.
    Greetings.


    ------------------
    Site map:

    [list]

  • scripting@wanadoo.nl
  • History of Site/Last info of Site
  • Links to Favorite Sites
  • Summary of Site

[This message has been edited by MCA (edited 28 June 2001).]

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA