Search found 5 matches

by Hugo
09 Apr 2013 20:21
Forum: DOS Batch Forum
Topic: is it possible to use Delayed Extended in a command line?
Replies: 9
Views: 8509

Re: is it possible to use Delayed Extended in a command line

Hi Endoro,
if I understand correctly, %~i is to remove the doble quotes inside %i. But I think that in

Code: Select all

for %i in (*.txt) ...

the var %i never has doble quotes. Am I wrong?
by Hugo
07 Apr 2013 21:05
Forum: DOS Batch Forum
Topic: is it possible to use Delayed Extended in a command line?
Replies: 9
Views: 8509

Re: is it possible to use Delayed Extended in a command line

Hi abc0502

No, the result is the same.
The problem is with Delayed Extended applied to the variable "Name", !Name! does not work
by Hugo
07 Apr 2013 20:40
Forum: DOS Batch Forum
Topic: is it possible to use Delayed Extended in a command line?
Replies: 9
Views: 8509

is it possible to use Delayed Extended in a command line?

This works ok in a bat file: @echo off setlocal enabledelayedexpansion for %%i in (*.txt) do (set Name=%%~nxi&echo ren "%%i" "!Name:~0,5!-MyNewText-!Name:~5!") (insert text in the middle of the file name) But in a single command line: @echo off&setlocal enabledelayedexpan...