There are several ways to do things in batch mode, so if you avoid the double percentage of %% , it doesn’t work for you, you can try something like this:
set olddir=%CD% cd /d "path of folder" del "file name/ or *.txt etc..." cd /d "%olddir%"
How it works:
set olddir=%CD% sets the variable "olddir" or any other variable name that you like in the directory your batch file was launched.
cd /d "path of folder" changes the current directory the batch will look at. keep quotes and change the path to the folder that you always wanted.
del "file name/ or *.txt etc..." will delete the file in the current directory the package is looking at, just don’t add the directory path in front of the file name and just don’t use the full file name or to delete several files with the same extension using *.txt or any other extension you need.
cd /d "%olddir%" takes the variable stored with your old path and returns to the directory in which you ran the package, it doesn’t matter if you do not want the package to return to the previous directory path, and as indicated above, the variable name can be changed to whatever you wish by changing set olddir=%CD% line .
user1931470 Oct 18 2018-12-18T00: 00Z
source share