Oops for underscore to hyphen you want
replace.bat -files "-" "_" C:\files\to\rename
Or maybe the other way.. Damn looks like ive mixed the old and new up in the example ?
Search found 40 matches
- 16 Dec 2011 10:12
- Forum: DOS Batch Forum
- Topic: DOS Batch / XP Command prompt file rename to remove spaces.
- Replies: 10
- Views: 22556
- 16 Dec 2011 10:10
- Forum: DOS Batch Forum
- Topic: DOS Batch / XP Command prompt file rename to remove spaces.
- Replies: 10
- Views: 22556
Re: DOS Batch / XP Command prompt file rename to remove spac
My script above will do that. Paste it into a file called replace.bat. Then
replace.bat -files new old C:\tmp
i.e:
Replace.bat -files "-" " " c:\filestorename\
replace.bat -files new old C:\tmp
i.e:
Replace.bat -files "-" " " c:\filestorename\
- 12 Jan 2010 13:59
- Forum: DOS Batch Forum
- Topic: Processing reserved charectors in a batch
- Replies: 2
- Views: 4893
depending on what ou are doing, sed, grep, awk may be more suited to this. These can be called and controlled from a batch script. Also, consider storing the data in temp text files rather than in variables. As mentioned handling these sort of things is a pain in cmd, and often involves terribly ugl...
- 17 Oct 2009 09:38
- Forum: DOS Batch Forum
- Topic: Change Variable In File
- Replies: 1
- Views: 4679
- 16 Oct 2009 12:35
- Forum: DOS Batch Forum
- Topic: get ip for batch commands
- Replies: 6
- Views: 9103
- 18 Sep 2009 03:32
- Forum: DOS Batch Forum
- Topic: file read
- Replies: 2
- Views: 5545
Code: Select all
for /f %%A IN (file.txt) DO (
IF "%%A"=="value" ECHO MATCH
)
- 29 Aug 2009 12:28
- Forum: DOS Batch Forum
- Topic: How do I determine the number of arguments?
- Replies: 7
- Views: 11461
- 27 Aug 2009 16:43
- Forum: DOS Batch Forum
- Topic: Newbie here needs help to manipulate file names
- Replies: 11
- Views: 14266
- 27 Aug 2009 16:28
- Forum: DOS Batch Forum
- Topic: How do I determine the number of arguments?
- Replies: 7
- Views: 11461
- 27 Aug 2009 08:39
- Forum: DOS Batch Forum
- Topic: How do I determine the number of arguments?
- Replies: 7
- Views: 11461
m This should be helpful and fairly clear to understand. It's pretty flexible and fairly robust i think. posted here as well : @echo off SETLOCAL ENABLEEXTENSIONS SETLOCAL ENABLEDELAYEDEXPANSION SET InDir=X:\tobeprocessed SET OutDir=X:\processed SET tifDir=%OutDir%\tifs SET jpgDir=%OutDir%\jpgs SET ...
- 27 Aug 2009 08:33
- Forum: DOS Batch Forum
- Topic: Using a batch file to verify .jpg as image files
- Replies: 2
- Views: 6152
- 21 Aug 2009 08:08
- Forum: DOS Batch Forum
- Topic: Force quotes to protect DnD arguments
- Replies: 2
- Views: 5549
- 30 Jul 2009 05:46
- Forum: DOS Batch Forum
- Topic: Batch script to move files
- Replies: 13
- Views: 20636
- 25 Jun 2009 15:42
- Forum: DOS Batch Forum
- Topic: FOR not loading files with extremely long line
- Replies: 3
- Views: 6541
- 25 Jun 2009 14:44
- Forum: DOS Batch Forum
- Topic: HELP with "FOR LOOP" inside another
- Replies: 12
- Views: 15492