Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Batch file that renames updates in the 8.3 format

- - - - -

  • Please log in to reply
1 reply to this topic



    Senior Member

  • Member
  • PipPipPipPip
  • 596 posts
  • Joined 24-June 03
I am looking to make a batch file that wold rename all the files in a given directpry in the 8.3 file name format. The file should rename the files like Q#######.exe, KB######.exe

How to remove advertisement from MSFN

Fuzzy Viking

Fuzzy Viking


  • Member
  • 17 posts
  • Joined 26-February 04
You would need 2 batch files

1 for the main routine and 1 for a subroutine :

MAIN : r.bat
@echo off

echo Renaming Q*.EXE

for %%F in (Q*.EXE) do call name.bat %%F

echo Renaming KB*.EXE

for %%F in (KB*.EXE) do call name.bat %%F
SUB : name.bat
@echo off

set name=%1
set newname=%name:~0,8%.EXE
ren %name% %newname%

The first batch file loops thru the files matching the given filter, and then calls the renaming batch file for each of them.

The reason you need two files is that you can only run 1 command in the for loops

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users