Page 1 of 1

basic rename file.exe to same as the fold it is in

PostPosted: Tue Nov 15, 2011 3:54 am
by akieal
Hi

All I want to do is rename PATCH.exe to be renamed to the foldername its in eg: \TEST\PATCH.EXE
And make my script renames it to TEST.exe
Here is what I have done (simplified example):

I have a file "PATCH.EXE" that is in a folder \test\

so I created a file in notepad named "SCRIPT.BAT" and added the command to the SCRIPT.BAT:

BRC32 /PATTERN:"PATCH.EXE" /REMOVEFIRSTN:5 /APPENDFOLDER:S::1 /EXECUTE

but when I run my SCRIPT.BAT it just outputs the following and does not rename my PATCH.exe:

Processing Folder C:\TEST\

Help please! What is wrong with my script.

Thank you :cry:

Re: basic rename file.exe to same as the fold it is in

PostPosted: Tue Nov 15, 2011 4:56 am
by akieal
Not to worry I figured it out, my script was not working because of my match pattern seems to be cause sensitive.

Once I changed it from this:
Code: Select all
BRC32 /PATTERN:"PATCH.EXE" /REMOVEFIRSTN:5 /APPENDFOLDER:S::1 /EXECUTE


to this:
Code: Select all
BRC32 /PATTERN:"PATCH.exe" /REMOVEFIRSTN:5 /APPENDFOLDER:S::1 /EXECUTE


It worked!

Thanks :D

Re: basic rename file.exe to same as the fold it is in

PostPosted: Wed Nov 23, 2011 4:30 am
by Admin
Thank you for posting the solution! :D