Hello,
i want to decrypt every file within a folder. For this task i need the filename without the directory part. So i tried the following:
@echo off
SET SrcDir=C:\scripts\SrcDir
SET DestDir=C:\scripts\DestDir
for %%D in ("%SrcDir%"\*.*) do (
SET FILE=%%D
SET FILE=%file:C:\Scripts\SrcDir\=%
TOOL.exe --output %DestDir%\dec_%file% --decrypt
)
%%D returns the full file path e.g C:\scripts\SrcDir\test.txt
Maybe it is possible to write something like that:
SET FILE=%file:%SrcDir%=%
Thank you for help.
Viper
string substituation within for loop
Moderator: DosItHelp
Re: string substituation within for loop
Use %%~nxD instead of %%D. See details in the command for Help.
Re: string substituation within for loop
Hello,
@!K: Thank you, it works.
Viper
@!K: Thank you, it works.
Viper