Main Site | Forum | Rules | Downloads | Wiki | Features | Podcast

NLSC Forum

Discussion about NBA Live 2003.
Post a reply

question about batch-files

Sat Apr 26, 2003 11:15 pm

I learned to make batch files,
what command have to I type to make the prog clear the screen?

Sun Apr 27, 2003 6:26 pm

"CLS", without the quotations.

thanks

Mon Apr 28, 2003 12:56 am

thanks for help.

reply

Mon Apr 28, 2003 10:51 pm

Is it possible for the batch to RENAME a file? If is, how?

Tue Apr 29, 2003 6:05 pm

Of course. The command is:

REN (old name) (newname)

Make sure you include all file extensions (eg .fish) when renaming.

Tue Apr 29, 2003 6:06 pm

"ren" without the quotation marks.

so if you typed...

"ren xxxxx.fsh mijorda.fsh" without the " marks then that would rename xxxxx.fsh to mijorda.fsh. (Y)

Tue Apr 29, 2003 8:03 pm

You might also be interested in the MOVE command. It can save you the trouble of executing two commands in batch file (eg COPYing a file, then DELeting it).

reply

Tue Apr 29, 2003 11:46 pm

Thanks for help again. I knew the move command.... I think making batch files is fun :lol:

more

Wed Apr 30, 2003 12:11 am

Oh, forgot to ask.
Is there any more cool commands I could be interested in?

Wed Apr 30, 2003 3:25 am

If you want to write stuff to the person using the batch file, write
@echo off
at the top of the batch file, and then when you want to say something, use
echo Hello! This installs the VC update...

The other thing to do is when you run a batch file with something you'd like to use in it, like "if you want to exit press control c" or something, right click on the file and choose edit, and then you can "steal" the code.

Wed Apr 30, 2003 4:28 pm

There's also a PAUSE command. I use this in the NLSC roster update, after the "Press Control-C to abort installation" line.

Code:
ECHO You can press CRTL-C at any time to abort.
ECHO.
PAUSE

Wed Apr 30, 2003 9:59 pm

Qweet wrote:If you want to write stuff to the person using the batch file, write
@echo off
at the top of the batch file, and then when you want to say something, use
echo Hello! This installs the VC update...

Hey Qweet, Can you explain further what you mean? i'm just curious...sounds like a cool command...
(i've always just used @ echo off

more

Wed Apr 30, 2003 10:15 pm

:lol: I added a cool batch file to my VC patch
Grab the patch here:
http://koti.mbnet.fi/finnboy/FB-VC3-FB.zip

The batch first deletes all the files in VC:s folder, then adds the files there, and if there isn't the folder, it creates one. :wink:

Wed Apr 30, 2003 10:17 pm

The ECHO command is used pretty well for making the bat program user friendly. For example, you could say "hey welcome to my patch", describe what the patch does, say "patch installed succesfully!" at the bottom, etc. This is an example of a batch with no @echo off and no echo's

Code:
ren happy.txt sad.txt
del sad.txt
pause

Image

And here's one with some nice echo's

Code:
@echo off
echo Welcome to my redundant patch!
echo Renaming happy.txt to sad.txt...
ren happy.txt sad.txt
del sad.txt
echo sad.txt is deleted successfully!:)
pause

Image

As you can see, the second one is much more user friendly than the first. BTW, all the @echo off command is for other than enabling the ECHO command is so that the statements that are executing (ie Ren and Del) are not outputted to the screen.

Thu May 01, 2003 1:44 pm

You can also ensure that the command lines are not printed on screen by adding "> NUL" after a command. For example:

Code:
IF NOT EXIST saves\000\players.dbf MD saves [b]> NUL[/b]

Sun May 04, 2003 2:13 am

I would like to know from the beginning how to make batch file.

Sun May 04, 2003 5:08 am

After looking in a cyberface batch file I could figure out a little bit the system. So I actually managed to do a batch files that extract all the files,
delete the old ones and creating new ones (if there were none).
But in my Roster Patch I have 2 saves, which means that I have 2 of everything, and beacause that I have to rename them (as you were talking about) to make it work.

But it didnt work. It copied but, it didnt changed the names!

ren VC4.jpg VC5.jpg
pause
md Test\000 >nul
md Test\001 >nul
move VC4.jpg Test\000\
move VC5.jpg Test\001\

They both got were I wanted them, but I wanted VC4.jpg to be renamed to VC5.jpg.
But I got some stupid error message instead. HELP!

Sun May 04, 2003 6:03 am

what command is there for automatic install?, so you don't have to push a button wgen installing?

Sun May 04, 2003 9:09 am

Slam harder wrote:After looking in a cyberface batch file I could figure out a little bit the system. So I actually managed to do a batch files that extract all the files,
delete the old ones and creating new ones (if there were none).
But in my Roster Patch I have 2 saves, which means that I have 2 of everything, and beacause that I have to rename them (as you were talking about) to make it work.

But it didnt work. It copied but, it didnt changed the names!

ren VC4.jpg VC5.jpg
pause
md Test\000 >nul
md Test\001 >nul
move VC4.jpg Test\000\
move VC5.jpg Test\001\

They both got were I wanted them, but I wanted VC4.jpg to be renamed to VC5.jpg.
But I got some stupid error message instead. HELP!


You say that both files were moved properly... but you can't rename VC4 to VC5. This is because you already have a file called VC5 in the same directory as VC4, so it can't rename it to a filename that already exists. There are a few ways to fix this, the easiest way I can think of would be this:
Code:
pause
md Test\000 >nul
md Test\001 >nul
move VC5.jpg Test\001\
ren VC4.jpg VC5.jpg
move VC4.jpg Test\000\


Try this now, it should work.

Sun May 04, 2003 7:18 pm

Thanx 4 the help but I managed to fix it in another way after looking in
Andrew`s update

Mon May 12, 2003 3:46 am

hmm, i got a complain about a .bat file i made..., my question is; do you need to have the folder that is specefied in the .bat file?, i meen, if the bat file will send a file to the xcommon folder, do you need to have that there already?

Mon May 12, 2003 11:59 am

If it's not there, you can create it with the MD command:

MD foldername

You can also see if a folder/file exists. I use this command in the NLSC roster update:

IF NOT EXIST saves\000\players.dbf MD saves\000

more...

Sat May 17, 2003 3:30 pm

Is it possible for a batch file to run a program, for example another batch file or a .exe file? If if, how?
This could enable many possibilities.... :P

Re: more...

Sat May 17, 2003 4:42 pm

Finnboy wrote:Is it possible for a batch file to run a program, for example another batch file or a .exe file? If if, how?
This could enable many possibilities.... :P

Nah, forget it, I figured it out already.
Check my discovery at the NBA Live 2003 Announcements
under the topic named:
FIRST TIME EVER - CHANGING CORNROWS FOR AI
:wink:
Post a reply