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


Photo

Batch file that renames updates in the 8.3 format

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Sunil

Sunil

    Senior Member

  • Members
  • PipPipPipPip
  • 596 posts
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

#2
Fuzzy Viking

Fuzzy Viking

    Newbie

  • Members
  • 17 posts
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




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users



How to remove advertisement from MSFN