- Local time
- 6:26 AM
- Posts
- 1,001
- Location
- Central Florida, USA
- OS
- Win-11/Pro/64, Optimum 11 V3, 23H2 22631.3085
I want to use the Rename (ren) command in a batch file, to rename four files of the same name, that are located in four different directories, throughout Windows. Unlike several other DOS commands, REN does not allow for the /s switch, which would allow it to do it's work in many sub directories.
So my question: Is there some way, in DOS batch file language, where I can first run the DIR (Directory) command to find the location of the four files that I want to rename, and then send that info to the REN command, to rename those four files?
It's been too many years, since I've written anything but the most basic Batch Files, and I'm suffering from the "Use it or loose it" syndrome.
In the instance that I've eluded to above, I could possibly write a four line batch file, to rename the four program files, however, two of the paths are so long they would run off of the side of the CMD box. It would be great, if I could just write a one-liner to do the whole job.
Any and all help would be greatly appreciated.
Thank You,
TechnoMage
So my question: Is there some way, in DOS batch file language, where I can first run the DIR (Directory) command to find the location of the four files that I want to rename, and then send that info to the REN command, to rename those four files?
It's been too many years, since I've written anything but the most basic Batch Files, and I'm suffering from the "Use it or loose it" syndrome.
In the instance that I've eluded to above, I could possibly write a four line batch file, to rename the four program files, however, two of the paths are so long they would run off of the side of the CMD box. It would be great, if I could just write a one-liner to do the whole job.
Any and all help would be greatly appreciated.
Thank You,
TechnoMage
My Computer
System One
-
- OS
- Win-11/Pro/64, Optimum 11 V3, 23H2 22631.3085
- Computer type
- PC/Desktop
- Manufacturer/Model
- Home Made w/Gigabyte mobo/DX-10
- CPU
- AMD FX 6350 Six Core
- Motherboard
- Gigabyte, DX-10, GA-78LMT-USB3
- Memory
- Crucial, 16 GB
- Graphics Card(s)
- Onboard, ATI Radeon HD 3000; NVIDEA GeForce 210, 1GB DDR3 Ram.
- Sound Card
- Onboard
- Monitor(s) Displays
- 24" Acer
- Screen Resolution
- 1280x800
- Hard Drives
- Crucial SSD 500GB, SanDisk 126GB SSD, Toshiba 1TB HD
- PSU
- EVGA 500 W.
- Case
- Pac Man, Mid Tower
- Cooling
- AMD/OEM
- Keyboard
- 101 key, Backlit/ Mechanical Switches/
- Mouse
- Logitech USB Wireless M310
- Internet Speed
- Hughes Net speed varies with the weather
- Browser
- Firefox 64x
- Antivirus
- Windows Defender, Super Anti Spyware
- Other Info
- Given to me as DEAD, and irreparable.
Rebuilt with Gigabyte mobo, AMD cpu, 16GB ram and 500GB Crucial SSD.