I want to rename a file which is present in the sub directory and the known part of the file name is '.log'. When I try something like below
ren subdirectory\*.log* file2.txt
or
ren .\subdirectory\*.log* file2.txt
I get error : The syntax of the command is incorrect.
I have two questions here:
Do I always need to give full path in ren command for file1?
If yes, then how can I we give the full path if I do not want to hard code it?
I got to know that we can use '%~dp0' to get the current directory path but I am not sure how to use it with 'ren'.
adding quotes will work:
ren "subdirectory\*.log*" file2.txt
or
ren ".\subdirectory\*.log*" file2.txt
Thanks wOxxOm !