Remove "-s" from *.lib file names For /f "tokens=2 delims=-" %%A In ('dir /b *.lib') Do (Ren "sfml-*-*.lib" "sfml-%%A.lib" 2>NUL) Remove "-s-d" from *.lib file names For /f "tokens=2 delims=-" %A In ('dir /b *.lib') Do (Ren "sfml-*-*-*.lib" "sfml-%A.lib" 2>NUL)įrom BATCH: (Add CD C:\folder location to the script) Remove "-s" from *.lib file names For /f "tokens=2 delims=-" %A In ('dir /b *.lib') Do (Ren "sfml-*-*.lib" "sfml-%A.lib" 2>NUL) More info on that here.įrom CMD: (Be sure to CD to directory location) By adding delims=- the statement will ignore all - in the parse. The problem in this scenario is that this only works if sfml-audio-s.lib was spaced sfml audio s.lib. This will tell the statement to only grab the second word in phrase. To grab only certain objects using a FOR statement, you can add /f "tokens=2" %%A. The issue now is that we only want audio in sfml-audio-s.lib. Using the command For /f %%A In ('dir /b *.lib') Do (Echo %%A) will list all the file names. The first thing the FOR statement will need is the filenames. To get around this, you will need to address what the * is. Meaning that the REN does not know what to put for the * in "sfml-*.lib". The problem is that Ren "sfml-*-*.lib" "" cannot assume the wildcard from the file path. Firstly, it looks like you're attempting to rename a file with only -s. Here are a few issue's you're having with your command.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |