2 Replies Latest reply on Feb 6, 2014 5:54 PM by Brian McEwen

    Deleting local file using dispatch

    Eric Doucet



      My process require me to convert a drawing to PDF and save it outside the vault with the new version.  Ex: PartA_R1.pdf


      When we re-approve this file, the Convert Task will create a new PDF outside the vault and name it PartA_R2.pdf


      We do not want to leave PartA_R1.pdf in the directory...  we only want to keep the latest version in the folder.


      In the vault, the latest file name would be for exemple, PartA.SLDDWR and by using the Dispatch tool, I am able to display the full name of the file on the local drive using a combination of strings and arithmetics functions stored in the %CurrentPDFVersion% variable with the OK MessageBox. 

      EX: The file %CurrentPDFVersion% will be deleted  => will display The file PartA_R2.pdf will be deleted


      Why does the Delete File Function with the argument filename:  c:\test\%CurrentPDFVersion% does not work???

      the file PartA_R2.pdf is stored in c:\test\


      and I try to change the argument of the Delete File Function to  c:\test\PartA_R2.pdf, then it Does work!  so I assume I am not far away from an answer...


      please help!


      Thank you,



        • Re: Deleting local file using dispatch
          Charley Saint



          Haven't run into this before, but try setting the %CurrentPDFVersion% variable to c:\test\PartA_R2.pdf and use only that in the delete dialog and see if that works for you.

          • Re: Deleting local file using dispatch
            Brian McEwen

            I'm testing something similar.  I noticed there is a delay -  I've seen it take a couple minutes for the file to disappear.


            Below image shows the 3 variables I used, since nesting functions didn't seem to work.  I used this to change extension to .pdf. 

            dispatch variables.JPG

            I also put in a message box that shows me the name of d_deletename so I know what it is trying to do, sounds like you have that already...

            The problem I'm actually having is I need a wild card.  I can't get it to work when there is an unknown date (inserted by pdf task) at the end of the filename (eg 42019 - Frame Holder Gear-02_06_2014.pdf).