Re: [PCWorks] How to create a batch file to rename a file, then rename it back?

  • From: "Clint Hamilton-PCWorks Admin" <PCWorks@xxxxxxxxxxxxxxxxxxxxxxxx>
  • To: <pcworks@xxxxxxxxxxxxx>
  • Date: Thu, 24 Jul 2008 00:14:16 -0500

Thanks Hugh, but that's not working, I though it looked a bit 
too simple. I tried on a test file, just as you put it:

ren E:\Backups\test.txt test1.txt

Even tried this with the full paths of both:

ren E:\Backups\test.txt E:\Backups\test1.txt

I click them and nothing happens.

This is going back to that long SP3 post of mine and the part 
regarding the patch MS sent me.  Well, the patch stopped 
working!  So now my only work-around is having to keep the 
causative file renamed, then when I need to use my FireWire HD 
rename to what it's supposed to be, then when I'm through 
rename it back to the other name.  Details on this are in these 
posts:
//www.freelists.org/archives/pcworks/07-2008/msg00004.html
//www.freelists.org/archives/pcworks/07-2008/msg00108.html

So it would be something like:

Existing file:
C:\WINDOWS\system32\drivers\BLAHsbp2port.sys

Renamed to the original when I need to use the FW HD:
C:\WINDOWS\system32\drivers\sbp2port.sys

Then renamed back to BLAH when I'm through with the HD.  The 
other folder in question I mentioned that may have to be 
involved is the dllcache folder.
Thanks,
-Clint

God Bless
Clint Hamilton, Owner
http://www.OrpheusComputing.com
http://www.ComputersCustomBuilt.com


----- Original Message ----- 
From: "Hugh Vandervoort"

Basically:
Use Notepad.

ren file.txt file.doc

Save this as "rename.bat"

ren file.doc file.txt

Save this as "rerename.bat"


These will execute by clicking.
Tell us more about what you're trying to do to get more 
options.



Karl Springer wrote:
> On 22 Jul 2008 at 9:35 -0500, Clint Hamilton-PCWorks Admin
> wrote, at least in part:
>
>> Can anyone please tell me how to make a batch file to rename
>> a file, then another one to rename it back to the original
>> name?
>
> Lots of expertise at
> <http://groups.yahoo.com/group/batchworld/>.
>
> Karl


=========================
The list's FAQ's can be seen by sending an email to 
PCWorks-request@xxxxxxxxxxxxx with FAQ in the subject line.

To unsubscribe, subscribe, set Digest or Vacation to on or off, go to 
//www.freelists.org/list/pcworks .  You can also send an email to 
PCWorks-request@xxxxxxxxxxxxx with Unsubscribe in the subject line.  Your 
member list settings can be found at 
//www.freelists.org/cgi-bin/lsg2.cgi/l=pcworks .  Once logged in, you have 
access to numerous other email options.  

The list archives are located at //www.freelists.org/archives/pcworks/ .  
All email posted to the list will be placed there in the event anyone needs to 
look for previous posts.
-zxdjhu-

Other related posts: