Old 17th February 2006, 14:03   #1
sam20_78
Junior Member
 
Join Date: Feb 2006
Posts: 6
Modifying a bat file

Hey Guys,

This is what I plan to do. We have a product which is already installed on the client machines. Its a java based client which runs through a bat file. now We need to send more updates to the Clients and We also need to make the changes in the bat file that is used to run the client program. I want to add REM in front of few lines and at the end of bat file i want to add few lines.

Now my question is how to achive this. I've seen various functions which will replace the text in a bat file. Can anyone please tell me how should i proceed.

Any help would be highly appreciated.

Thanks in advance.
sam20_78 is offline   Reply With Quote
Old 17th February 2006, 15:35   #2
sam20_78
Junior Member
 
Join Date: Feb 2006
Posts: 6
No response

i'm able to add the REM comments in the bat file using one of the functions that i found here
http://nsis.sourceforge.net/More_adv...e_text_in_file

now my question is how do i add some text at the end of the bat file. please help me.

Thanks in advance.
sam20_78 is offline   Reply With Quote
Old 17th February 2006, 15:52   #3
dienjd
Senior Member
 
Join Date: Oct 2005
Posts: 189
This covers it:
http://forums.winamp.com/showthread....39#post1749639
dienjd is offline   Reply With Quote
Old 17th February 2006, 16:09   #4
sam20_78
Junior Member
 
Join Date: Feb 2006
Posts: 6
dienjd,

Thanks a lot for showing me the way to do it.

Following code worked like a charm.

FileOpen $0 "path\to\file.txt" a
FileSeek $0 0 END
FileWrite $0 $1
FileClose $0

One more question. above code all adds the to a single line(i'm writing multiple lines using the File write.

it starts writing where the line ends not from the newline how do i write to the newline. Sorry if you find this a dumb question. i'm totally new to NSIS and have started playing with only yesterday.

Thanks again for you help
sam20_78 is offline   Reply With Quote
Old 17th February 2006, 16:16   #5
dienjd
Senior Member
 
Join Date: Oct 2005
Posts: 189
I was just the messenger on that one; it was Afrow_UK's code

To create a new line put a "$\r$\n" before each new line of text you want in your file.
dienjd is offline   Reply With Quote
Old 17th February 2006, 16:40   #6
sam20_78
Junior Member
 
Join Date: Feb 2006
Posts: 6
Thanks a lot man. You saved my day. Appreciate your help
sam20_78 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump