Jump to content

[CMD] Renaming multiple


Recommended Posts

hi there peeps, i have a little problem with this bit of code

@echo off
for /f "tokens=2 delims=-" %%i in ('dir /b *.exe') do (if not exist %%i.exe rename windows* %%i.exe)
exit

basically what i am trying to do is rename a bunch of hotfixes to there number ie kb123456 or q123456, but when i execute the script it renames the files but i get a message on every loop saying a duplicate file or file not found, what is going on or is this normal?

any help would be much appreciated

Lee

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...