Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
help w/ a simple batch file - pleas
Name: TommyCee Date: August 30, 2008 at 18:49:26 Pacific OS: XP CPU/Ram: 1GB Product: HPxw4400
Comment:
I had a directory of filenames like this:
rank(all)_so2_1hr_conc_A_2p5h10.dat
and wanted to crop
rank(all)_so2_1hr_conc_
I discovered a nice way to do this was by using this:
@echo off for %%i in (*.dat) do (set fName=%%i) & call :rename goto :eof :rename :: Crops the 1st 23 characters of fName ('rank(all)_so2_1hr_conc_'): ren %fName% %fName:~23% goto :eof
This results in this:
A_2p5h10.dat
Now I need to convert this to:
A_2p5h100.dat
Notice 'h10' needs top be 'h100'. Can you please suggest a routine that will add the '0' in the middle of the file name? There are hundreds of file names in the directory that need to have this conversion.
Summary: Hello: Need help with a DOS batch file. I am trying to write a very simple batch process, that checks if a DIR by the name MyFiles exists if it does not just creates it. Question is: How do I verify t...
Summary: hiya, I need to write a simple batch file - okay with that, say menu for dos with choices. But I need to enhance the batch files' capabilities by directly accessing ms-dos or bios interrupts via a sho...
Summary: Hi, I have written a very simple batch file to map a network drive. However can someone please tell me what I have to add to it to make the DOS window (When running in Windos 9x) disappear once it has...