| | |
renaming files through batch scripts...
![]() |
I need some help with renaming files using a batch script...
Say in a folder I have 2 html files. -
1.htm
2.htm
I need a bat file that will rename "1.htm" to "1a.htm" and then change "2.htm" to "1.htm"
In other words I need "2.htm" to become "1.htm"...
Anyone know how I can do this using a bat file?
cheers.
Say in a folder I have 2 html files. -
1.htm
2.htm
I need a bat file that will rename "1.htm" to "1a.htm" and then change "2.htm" to "1.htm"
In other words I need "2.htm" to become "1.htm"...
Anyone know how I can do this using a bat file?
cheers.
Pubonwheels - Mobile Bar Services for the South West of England.
The Kings Head Inn - The Kings Head, Underhill, Coleford, Somerset, UK.
South West Ravers - Going out to all you jungle drum and bass ravers.
UFB Live Radio - Keep It Locked.
The Kings Head Inn - The Kings Head, Underhill, Coleford, Somerset, UK.
South West Ravers - Going out to all you jungle drum and bass ravers.
UFB Live Radio - Keep It Locked.
from the command prompt:
navigate to the directory (folder) containing your files to be renamed.
create the batch file like this:
strike [enter] after each line
when done,
strike [ctrl]-z then [enter]
copy con means copy the output of the console
renameme.bat is the file that will be created
the other two lines will be added in turn to renameme.bat
the [ctrl]-z key combination, when followed by the [enter] key tells the copy command that you are done, and writes the file to disk
then, from the command prompt, simply type
followed by the [enter] key
and, voila'! instant file rename!!
navigate to the directory (folder) containing your files to be renamed.
create the batch file like this:
copy con renameme.bat ren 1.htm 1a.htm ren 2.htm 1.htm
strike [enter] after each line
when done,
strike [ctrl]-z then [enter]
copy con means copy the output of the console
renameme.bat is the file that will be created
the other two lines will be added in turn to renameme.bat
the [ctrl]-z key combination, when followed by the [enter] key tells the copy command that you are done, and writes the file to disk
then, from the command prompt, simply type
renameme
and, voila'! instant file rename!!
(o) Yes, I'd like to reboot my computer now.
Thanks for the help.
I've changed it slightly. New scrip reads...
This alows me to have 3 static pages that display status info, to change at the click of a button without updating any pages or html links. Only draw back is pages can become muddled if the script ends half way through - (ie before all pages are back to their original file names.)
Thanks again.
I've changed it slightly. New scrip reads...
@ECHO OFF ECHO Changing to status 2... ren status1.htm status1a.htm ren status2.htm status1.htm PAUSE ECHO Changing to status 3... ren status1.htm status2a.htm ren status3.htm status1.htm PAUSE ECHO Changing to status 1... ren status1.htm status3.htm ren status1a.htm status1.htm ren status2a.htm status2.htm ECHO Done PAUSE
This alows me to have 3 static pages that display status info, to change at the click of a button without updating any pages or html links. Only draw back is pages can become muddled if the script ends half way through - (ie before all pages are back to their original file names.)
Thanks again.
Last edited by NuGG; May 22nd, 2008 at 7:09 pm. Reason: missed off some code
Pubonwheels - Mobile Bar Services for the South West of England.
The Kings Head Inn - The Kings Head, Underhill, Coleford, Somerset, UK.
South West Ravers - Going out to all you jungle drum and bass ravers.
UFB Live Radio - Keep It Locked.
The Kings Head Inn - The Kings Head, Underhill, Coleford, Somerset, UK.
South West Ravers - Going out to all you jungle drum and bass ravers.
UFB Live Radio - Keep It Locked.
slightly!!lol
Fallen Heroes Song ,
http://www.youtube.com/watch?v=-RfXBB0BRHY
Going with the Flow ,but the water is low and the rocks are big
http://www.youtube.com/watch?v=-RfXBB0BRHY
Going with the Flow ,but the water is low and the rocks are big
![]() |
Other Threads in the Windows NT / 2000 / XP Forum
- Previous Thread: New HDD Appeared
- Next Thread: Power settings for new users
| Thread Tools | Search this Thread |
Tag cloud for Windows NT / 2000 / XP
.net 3.5 3daccelertion 64bit 2007 2010 activedirectory alaris android apache application arm auto automatically black blue book bsod bulletin canonical chinese chkdsk codeplex collaboration combofix computer crash deployments desktop desktops domain dotnetnuke downloads drive dual error explorer firefox folder fonts format freeze hardware home install internet killprocess laptop linux load mac memory microsoft mobile monitor motionle1600 netbooks nvidia open opensource operatingsystems options osinstallationproblem partition product program proxy raid rds reformat remotedesktopconnection repair retail retrieve screen security server. slowperformance sp1 studios technology ubuntu uninstall update upgrade usb verizon virtual virus volume vulnerability wab webos weecam windows windows7 windowsxp worm xp xpde






