Computing.Net > Forums > Disk Operating System > Batch file editing lines in sys.ini

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file editing lines in sys.ini

Reply to Message Icon

Name: Ted
Date: October 16, 2002 at 07:39:07 Pacific
OS: Win98
CPU/Ram: P4 256RAM
Comment:

I hope someone could help me. I would like to create a batch file that will replace the line 'shell=explorer' to 'shell=winfile' in c:\windows\system.ini. Anyone have any idea; or is this even possible? Thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: October 16, 2002 at 11:34:03 Pacific
Reply:

Yep, that's possible. The following script will do it:

===== BATCH SCRIPT BEGIN =====
@echo off
if not exist %windir%.\system.ini goto eof

:: ASCII assembler by Hebert Kleebauer
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=> %temp%.\SBS2.COM
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU!WvX0GwUY Wv;ovBX2Gv0ExGIuht6>> %temp%.\SBS2.COM
echo ?@}IKuNWpe~Fpe?FNHlF?wGMECIQqo{Ox{T?kPv@jeoSeIlRFD@{AyEKj@>> %temp%.\SBS2.COM
echo iqe~1NeAyR?mHAG~BGRgB{~H?o~TsdgCYqe?HR~upkpBG?~slJBCyA?@xA>> %temp%.\SBS2.COM
echo LZp{xq`Cs?H[C_vHDyB?Hos@QslFA@wQ~~x}viH}`LYNBGyA?@xAB?sUq`>> %temp%.\SBS2.COM
echo LRy@PwtCYQEuFK@A~BxPtDss@fFqjVmzD@qBEOEenU?`eHHeBCMs?FExep>> %temp%.\SBS2.COM
echo LHsPBGyA?@xAunjzA}EKNs@CA?wQpQpKLBHv?s`WJ`LRCYyIWMJaejCksl>> %temp%.\SBS2.COM
echo H[GyFGhHBwHZjjHeoFasuFUJeHeB?OsQH[xeHCPvqFj@oq@eNc?~}Nu??O>> %temp%.\SBS2.COM
echo ~oEwoAjBKs?Zp`LBzHQzyEFrAWAG{EFrAqAGYwHTECIQ{coKIsaCsf{Oe~>> %temp%.\SBS2.COM
echo CK}Ayre~CNFA{rAyEKFACrA{EKGAjbA}eKGSjNMtQFtc{OAyDGFj?{FDGQ>> %temp%.\SBS2.COM
echo KAjNVk_OCAx@e?f{o?CosI}1EGizhljJ~H1ZeG}JBA~rACBMDGjjDG@g0>> %temp%.\SBS2.COM

copy/y %windir%.\system.ini %temp%.\system.ini > nul

:: Set old and new string below. Warning: the process is case sensitive !
%temp%.\SBS2.COM 0 "shell=explorer" "shell=winfile" < %temp%.\system.ini > %windir%.\system.ini

del %temp%.\SBS2.COM

:eof
===== BATCH SCRIPT END =====

The search is case sensitive ('Explorer' is different from 'explorer'). A copy of system.ini is saved on the %temp% directory, as a backup.

If SED.exe is avaliable (not a common thing), this would also do it:

type %windir%.\system.ini |SED "s/shell=explorer/shell=windir/g" > %windir%.\system.ini

That would aslo be case sensitive.

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br

_________________________________________________________________________________________________________________


0
Reply to Message Icon

Related Posts

See More


Interlnk and Intersrv Laptop with No Cd-drive



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch file editing lines in sys.ini

BAT to replace line in system.ini ? www.computing.net/answers/dos/bat-to-replace-line-in-systemini-/13611.html

Replacing a Line in an Ini file www.computing.net/answers/dos/replacing-a-line-in-an-ini-file/17018.html

Dos Batch File www.computing.net/answers/dos/dos-batch-file/1218.html