Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Inserting new string txtsetup.sif with batch script

Featured Replies

I want insert new string in txtsetup.sif with batch script.

Example: this txtsetup.sif content,

[SourceDisksFiles]
bootvid.dll = 1,,,,,,3_,2,0,0,,1,2
kdcom.dll = 1,,,,,,3_,2,0,0,,1,2
c_1252.nls = 1,,,,,,3_,2,0,0,,1,2
c_437.nls = 1,,,,,,3_,2,0,0,,1,2

and i want add under the [sourceDisksFiles] this new string,

example.dll = 1,,,,,,3_,2,0,0,,1,2

and result must like this

[SourceDisksFiles]
example.dll = 1,,,,,,3_,2,0,0,,1,2
bootvid.dll = 1,,,,,,3_,2,0,0,,1,2
kdcom.dll = 1,,,,,,3_,2,0,0,,1,2
c_1252.nls = 1,,,,,,3_,2,0,0,,1,2
c_437.nls = 1,,,,,,3_,2,0,0,,1,2

How can i do bat or cmd script for this? Thanx for answers...


You need to create a new temporary file (that you can later rename as TXTSETUP.SIF

Something like this:

If exist new.sif del new.sif
FOR /F "tokens=* delims=" %%A IN (TXTSETUP.SIF) DO (
IF "%%A"=="[SourceDisksFiles]" (
ECHO [SourceDisksFiles]>>new.sif
ECHO example.dll = 1,,,,,,3_,2,0,0,,1,2>>new.sif
) ELSE (
ECHO %%A>>new.sif
)
)

Should do.

Otherwise you could use an external program like gsar:

http://home.online.no/~tjaberg/

Or any other search and replace utilities.

jaclaz

  • Author
You need to create a new temporary file (that you can later rename as TXTSETUP.SIF

Something like this:

If exist new.sif del new.sif
FOR /F "tokens=* delims=" %%A IN (TXTSETUP.SIF) DO (
IF "%%A"=="[SourceDisksFiles]" (
ECHO [SourceDisksFiles]>>new.sif
ECHO example.dll = 1,,,,,,3_,2,0,0,,1,2>>new.sif
) ELSE (
ECHO %%A>>new.sif
)
)

Should do.

Otherwise you could use an external program like gsar:

http://home.online.no/~tjaberg/

Or any other search and replace utilities.

jaclaz

Its work thanx, but have a fix,

ECHO example.dll = 1,,,,,,3_,2,0,0,,1,2>>new.sif

Leave a space beetween 0,,1,2 and >>new.sif

Thanx, working this..

Good suggestions and code so far. Here is an alternate way.

Your txtsetup.sif file looks like this.

[sourceDisksFiles]

bootvid.dll = 1,,,,,,3_,2,0,0,,1,2

kdcom.dll = 1,,,,,,3_,2,0,0,,1,2

c_1252.nls = 1,,,,,,3_,2,0,0,,1,2

c_437.nls = 1,,,,,,3_,2,0,0,,1,2

You want to insert the line "example.dll = 1,,,,,,3_,2,0,0,,1,2" right after the line "[sourceDisksFiles]" using a batch script.

Here is a biterscript (biterscripting script).

var str input, output; cat "txtsetup.sif" > $input
# Extract everything upto "[SourceDisksFiles]\n"
stex "^[SourceDisksFiles]\n^]" $input > $output
# Add "example.dll = 1,,,,,,3_,2,0,0,,1,2\n"
echo "example.dll = 1,,,,,,3_,2,0,0,,1,2\n" >> $output
# Add remaining portion of $input
echo $input >> $output
# Write file back.
echo $output > "txtsetup.sif"

biterscripting scripting or batch language is free at http://www.biterscripting.com .

Sen

Edited by SenHu

biterscripting scripting or batch language is free at http://www.biterscripting.com .

I doubt about it being "Free". :unsure:

It may be "Free as in free beer" but definitely NOT "Free as in freedom".

Basically one should download and install an unknown program from the internet, allowing it to by-pass firewall in order to get a serial number, the Agreement is shown AFTER the program has connected to the Server, and then we have something that is hardcoded to C:\biterScripting (please note that Windows uses backslash "\" and not forward slash "/" in paths):

http://www.biterscripting.com/install.html

:w00t:

With all due respect, there isn't a single word (even a "fake" one ) about WHO actually biterScripting.com is, the reason WHY it produced this scripting language, WHY it is giving it away for free, WHY it needs a connection and an online serial number, WHAT are the contents of the License Agreement, WHERE it is based, No e-mail, NO telephone number, NO hints about the Author(s).

It would be interesting if you could provide some of the info above. :)

jaclaz

  • Author

Well, i have another problem now, i want create with new file with cdm file :)

My cmd file content

echo echo example text>>abcd.txt>>createtext.cmd

im run cmd file but createtext.cmd content is this

echo example text

Wheras i want output like this

echo example text>>abcd.txt

What is delimiter character on dos ?

Thanks for answers...

  • Author
You need to "escape" special characters.

Try with:

echo echo example text^>^>abcd.txt>>createtext.cmd

jaclaz

Ah its working, jaclaz thanks for code, youre very good on dos, im to try with backslah like a php :P but unsuccess...

It's not DOS! It's the Windows NT Command Shell.

Bah, Humbug! The command syntax looks like MS-DOS, acts like MS-DOS, even has some of the same bugs as MS-DOS. (Although, it does have some newer and more inventive bugs than MS-DOS did.) I'll bet they kept 90% or more of the code exactly the same as it was for MS-DOS, when they tucked it up inside Windows. However, it is true that it is no longer a Disk Operating System, and in that regard, it truly is not DOS.

Just ruffling your feathers Yzöwl :lol:

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.