Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: SYSTEM.INI
We use WinBatch for an automated login procedure, and it works REALLY well. We have started to receive some problems on people's Win95 PC. The computer will start to boot, but halt just before loading the GUI. The message "Not enough extended memory to run Windows" is displayed and it just hangs. Inspection at the end of the system.INI shows hundreds of pages of the following:
[TTFontDimenCache] 0 12=5 12 [TTFontDimenCache] 0 13=6 12(Numbers vary, but you can see the structure).
Client OS: Win95
WinBatch version: 96M
This network login procedure has modified system.ini for about 12 months with no issues. We use IniWritePvt to modify the system.ini.
Do you know what generates these entries? Thanks once again for the fantastic support.
We've seen occasional problems where a non-dos compatible editor (defined as putting a CRLF after every line) is used to edit the file and only puts a LF after some of the lines. Slow cannabilization of the ini file starts. But the symptoms are different from what you describe. I've heard of no other reports of anything like that.
IniWritePvt("","","","system.ini")to force an immediate write of the system.ini to disk after the update.
I have no idea how to delete the 386 Enh section of the sys.ini and replace it with a new one.
iniwritepvt("","","","inifilename.ini")
The BinaryFunctions are kind of a rough introduction to programming. I would...Read all the binary functions. Copy the examples. Run them. Understand exactly how they work. See:
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/How~To/System~INI~and~INI~File~Topics+System~Ini~~-~Writing~multiple~device~lines~to.txt
Make a copy of your system.ini. Try editing the copy. Look at it carefully. Make sure the edits worked. Try other cases.
KEEP GOOD BACKUPS FOR A WHILE OF THE SYSTEM.INI FILE UNTIL YOU FINISH THE CHANGES!!!
It is just incidental that they can be used to edit the system.ini file device = section.
An alternate way to update system.ini directly might be with FileRead/Write operations:
filein = FileOpen("c:\windows\system.ini","READ") fileout = FileOpen("c:\windows\system.out","WRITE") line = "" While line <> "*EOF*" line = StrTrim(FileRead(filein)) If StrSub(StrUpper(line),1,7) == "DEVICE=" Then Continue ; don't write Device lines If StrSub(StrUpper(line),1,7) == "DEVICE " Then Continue FileWrite(fileout, line) EndWhile FileClose(filein) FileClose(fileout) FileCopy ("c:\windows\system.out","c:\windows\system.ini",0) ;the above writes every line, except those that begin (excluding leading spaces) ;device= or device = or device settings = etc. ;further line checking is possible. ;you can also check for sections, so that you only do it within ;[386Enh] section or whatever
I think the system.ini - especially the device= section - is mainly referred to at system bookup time - not while it is running. So you will have to reboot your computer after the changes.
Modifications to device= lines will not take effect until the next time you boot up the computer. So you could either modify it then reboot, or in the autoexec.bat file, before windows really gets going - swap in the desired system.ini there. But I think the best way is to have two SYSTEM.INI files, as is discussed below.
Add a new section to both files (with notepad) like thus:
[WHOAMI] IAM=APPA (or APPB in the other one)So your WinBatch script would work like this. (You can make a more elegant script that this, but this will get you started.)
;=======snip============ whoami=IniReadPvt("WHOAMI","IAM","???","SYSTEM.INI") ans=AskYesNo("%whoami% INI file loaded","Press YES to load APPA%@CRLF%Press NO to load APPB %@CRLF%Press Cancel to quit") APPAINI="c:\windows\appa.ini" APPBINI="c:\windows\appb.ini" system="c:\windows\system.ini" If ans==@YES FileCopy(APPAINI,SYSTEM,0) else FileCopy(APPBINI,SYSTEM,0) endif IntControl(67,0,0,0,0) ;============snip==============Then to reboot automatically, use:
IntControl(67,0,0,0)is safe.
IntControl(67,0,1,0,0)is not.
Article ID: W13345
Filename: Writing to the System INI file.txt
File Created: 2017:08:29:11:59:00
Last Updated: 2017:08:29:11:59:00