Search found 6 matches
- 23 Mar 2016 06:58
- Forum: DOS Batch Forum
- Topic: how to rename unknown source file names to fixed file names
- Replies: 3
- Views: 3728
Re: how to rename unknown source file names to fixed file names
Hi, maybe that is what you are looking @echo off & setlocal enabledelayedexpansion cls set "type=.txt" set /a Nr=100 set /a Nr+=1 pushd "%~dp0" REM first loop for /f "delims=" %%i in ('dir /b /a-d /on "*%type%" 2^>nul') do ( ren %%i "%%~ni-!Nr:~-2!%ty...
- 28 Feb 2016 05:40
- Forum: DOS Batch Forum
- Topic: Re-Number files
- Replies: 6
- Views: 6581
Re: Re-Number files
Hi, here a small oneliner, pase the code in cmd box where the jpg/tga located cmd /v:on /c "for /f %i in ('dir /b /a-d "*.jpg" "*.tga"') do @(set "file=%~ni" &set "file=!file:~-4!" &echo ren %i !file!%~xi)" remove the echo to finally rename n...
- 06 Sep 2015 09:44
- Forum: DOS Batch Forum
- Topic: Problem with loop and composited new variable
- Replies: 5
- Views: 5792
Re: Problem with loop and composited new variable
Yury wrote:Code: Select all
@echo off
setlocal enabledelayedexpansion
set "oldV=aaa bbb ccc ddd"
set "addV=wow_"
set "newV=%addV%!oldV: = %addV%!"
echo %newV%
Thx, very nice implementation.
- 04 Sep 2015 07:11
- Forum: DOS Batch Forum
- Topic: Problem with loop and composited new variable
- Replies: 5
- Views: 5792
- 04 Sep 2015 06:52
- Forum: DOS Batch Forum
- Topic: Problem with loop and composited new variable
- Replies: 5
- Views: 5792
Problem with loop and composited new variable
Hi I would like to add a wow_ to the old variable set "oldV=aaa bbb ccc ddd" and the finished variable should look like set "newV = wow_aaa wow_bbb wow_ccc wow_ddd " I get it only to: @echo off Setlocal EnableDelayedExpansion set "addV=wow_" set "oldV=aaa bbb ccc d...
- 07 Feb 2015 15:17
- Forum: DOS Batch Forum
- Topic: Batch renaming issue
- Replies: 8
- Views: 7898
Re: Batch renaming issue
hi, put the batch file in same directory as your *.docs @echo off & setlocal enabledelayedexpansion & title %~n0 cls :: same directory as the file type set "Directory=%~dp0" :: file type set "Type=doc" pushd "%Directory%" || goto :eof for /f "delims=" ...