Will
April 29th, 2004, 04:44 AM
At the request of Imperator Fyron, I have created a batch file script that takes all files in a directory, then creates copies of it in all subdirectories, while prefixing the file with the name of the directory and an underscore (_).
Apparently, this would be quite useful to create generic copies of AI files in several subdirectories http://forum.shrapnelgames.com/images/icons/shock.gif http://forum.shrapnelgames.com/images/smilies/rolleyes.gif http://forum.shrapnelgames.com/images/icons/icon6.gif
linky link (http://www-scf.usc.edu/~wmorrell/se4/ai_file_copy.bat)
As I don't really have SEIV installed on my computer here, I don't know if this works perfectly. As I remember the AI files, it *should* work. Pretty much, like I said, it just takes the subdirectory (race) name, tacks it on front of the file name with an underscore, and copies the file to the subdirectory. So if you have a set of generic AI template files (sans the race name and underscore) in a directory, you can create one or two or fifty subdirectories, place this script in the directory, double click, and it should automagically do the copying/renaming for you.
I made it on a Windows 2k box, so it should work on 2k, NT, and XP. I have no idea if it will work on 9x. If someone could test it out, that would be grand. If it doesn't work, and someone else doesn't create a 9x Version by the time I get home (mid-May), I'll (hopefully) post a 9x Version then.
Free (as in speech, and as in beer) for everyone. Download, copy, distribute to your heart's content. It's only one line of code, anyway http://forum.shrapnelgames.com/images/icons/icon7.gif It would be appreciated if people did too, I'll probably take it down in a week or so... actually...
... since it *is* just one line of code...
</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
for /D %%d in (*) do @for %%f in (*.txt) do @copy %%f .\%%d\%%d_%%f
</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">... copy that into a file, give it a .bat extension, and run to your heart's content. I'll leave the link for a while for the more lazy among us. After I take the link down, the code will still be here. Ha!
(Now Fyron, aren't you glad you didn't go about writing a C program to do this? http://forum.shrapnelgames.com/images/icons/icon12.gif http://forum.shrapnelgames.com/images/icons/icon10.gif )
Apparently, this would be quite useful to create generic copies of AI files in several subdirectories http://forum.shrapnelgames.com/images/icons/shock.gif http://forum.shrapnelgames.com/images/smilies/rolleyes.gif http://forum.shrapnelgames.com/images/icons/icon6.gif
linky link (http://www-scf.usc.edu/~wmorrell/se4/ai_file_copy.bat)
As I don't really have SEIV installed on my computer here, I don't know if this works perfectly. As I remember the AI files, it *should* work. Pretty much, like I said, it just takes the subdirectory (race) name, tacks it on front of the file name with an underscore, and copies the file to the subdirectory. So if you have a set of generic AI template files (sans the race name and underscore) in a directory, you can create one or two or fifty subdirectories, place this script in the directory, double click, and it should automagically do the copying/renaming for you.
I made it on a Windows 2k box, so it should work on 2k, NT, and XP. I have no idea if it will work on 9x. If someone could test it out, that would be grand. If it doesn't work, and someone else doesn't create a 9x Version by the time I get home (mid-May), I'll (hopefully) post a 9x Version then.
Free (as in speech, and as in beer) for everyone. Download, copy, distribute to your heart's content. It's only one line of code, anyway http://forum.shrapnelgames.com/images/icons/icon7.gif It would be appreciated if people did too, I'll probably take it down in a week or so... actually...
... since it *is* just one line of code...
</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
for /D %%d in (*) do @for %%f in (*.txt) do @copy %%f .\%%d\%%d_%%f
</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">... copy that into a file, give it a .bat extension, and run to your heart's content. I'll leave the link for a while for the more lazy among us. After I take the link down, the code will still be here. Ha!
(Now Fyron, aren't you glad you didn't go about writing a C program to do this? http://forum.shrapnelgames.com/images/icons/icon12.gif http://forum.shrapnelgames.com/images/icons/icon10.gif )