Home | Gallery | Forum | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com Forum
OS2 World.Com Online Discussion Forum.
Index / OS/2 - General / Programming
author message
Change config.sys
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
Bille
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 2
since: 31 Aug, 2005
1. Change config.sys
Reply to this topic with quote Modify your message
Hello!

I have to change a setting in the file "config.sys" of 150 Clients.
(Insert "P:\acrobat3\acroread" in line beginning with "LIBPATH")

I'd like to send an email with a batch-file to all users, which does this change.

I don't know anything about REXX or something like that, but I think it's maybe a little code for you and a big help for me ...

It would be very nice, if you can help me.

Thx
Bille

PS: Sorry for my bad english ...

Date: 31 Aug, 2005 on 16:37
zircon
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 7
since: 03 May, 2005
2. Re:Change config.sys
Reply to this topic with quote Modify your message
last updated at 01 Sep, 2005 06:23 (1 times)
This may work.... I'm assuming all of the systems have REXXUTIL installed.
Be sure to test it yourself before distributing!
(As written the script is case sensitive, so it will happily add an existing path again if the case is different.)


/*REXX script to add (something) to the libpath line in <sysdrive>:\config.sys*/
call rxFuncAdd "SysLoadFuncs", "REXXUTIL", "SysLoadFuncs"
Call SysLoadFuncs

/*Text to add is: (something)*/
addtext="P:\acrobat3\acroread;"

/*Find boot drive*/
signal on Syntax name GetOS2BootDrive1 /* install a local error handler */

boot_drive = ''
boot_drive = SysBootDrive()


/*Make temporary file*/
tmp= VALUE( "TMP",, "os2environment" )
tempfile=systempfilename(tmp||"\config.t???" )

modified=0 /*The config.sys has not yet been modified.*/

/*Read lines in config.sys, writing them to a temporary file*/
configsys= boot_drive||"\config.sys"
do while lines(configsys)>0
line=linein(configsys)
parse var line begg "=" endd
select
when strip(translate(begg))="LIBPATH" then do
/*Find out whether libpath line ends in ";" and add as necessary*/
if right(strip(endd),1)<>";" then endd=strip(endd) || ";"
/*Add (something) to libpath if it doesn't yet exist*/
if pos(addtext,endd)=0 then endd=endd || addtext
else signal cleanup
/*Find out whether libpath line ends in ";" and add as necessary*/
if right(strip(endd),1)<>";" then endd=strip(endd) || ";"
rc=lineout(tempfile,begg || "=" || endd)
end /* do */
otherwise rc=lineout(tempfile,line) /*Write rest of config.sys to temporary file*/
end /* select */
end /* do */

/*If the above ran through, then config.sys has been modified.*/
modified=1


/*Close config.sys and tempfile*/
rc=stream(configsys,"C","CLOSE")
rc=stream(tempfile,"C","CLOSE")


/*Find last existing config.Tnn file (by number)*/
t=0
do i=1 to 99
dd=right(i,2,0)
temp.i=stream(boot_drive || '\CONFIG.T' || dd, 'c', 'QUERY EXIST' )
end /* do */
do i=99 to 0 by -1
if temp.i<>"" then signal nextt
end /* do */
nextt:
tbackup=boot_drive || "\config.t" || right(i+1,2,0)

/*Copy config.sys to config.Tnn+1 */
"copy " configsys tbackup

rc=stream(configsys,"C","CLOSE")
rc=stream(tbackup,"C","CLOSE")

/*Copy temporary file to config.sys*/
if translate(stream(tbackup, 'c', 'QUERY EXIST' ))=translate(tbackup)
then "copy" tempfile boot_drive || "\config.sys"

cleanup: /*Delete temporary file*/
rc=stream(tempfile,"C","CLOSE")
call SysDestroyObject tempfile

select
when modified=0 then do
say "Config.sys has NOT been modified"
say "because LIBPATH already contained '" || addtext || "'."
end /* do */
when modified=1 then do
say "Config.sys has been modified."
say "'" || addtext || "' was added to the LIBPATH."
say "The old config.sys has been backed up as '" || tbackup "'."
end /* do */
otherwise do
say "This script has a bug."
say "Please contact the system administrator."
end
end /* select */
exit

GetOS2BootDrive1:
ok=0
if boot_drive = '' then
do
path=translate(VALUE( "PATH",, "os2environment" ) )
parse var path begg "\OS2\SYSTEM;" endd
boot_drive=right(begg,2)
end
if stream(boot_drive || '\CONFIG.SYS', 'c', 'QUERY EXIST' )=boot_drive||"\CONFIG.SYS" then ok=1
if ok=1 then return boot_drive
else do
say "Couldn't positively identify boot drive."
say "so your system has NOT been modified."
say "Contact your friendly administrator."
say "(Press ENTER to quit.)"
end /* do */
pull
exit

Date: 01 Sep, 2005 on 05:43
Radek
Premium member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 121
since: 17 Jul, 2003
3. Caveat!!
Reply to this topic with quote Modify your message
Guessing from the folder name, I think you are going to upset your clients rather quickly. Acrobat 3 is unable to read *most* of contemporary .pdf, including the OS/2 related ones!

You'd better install Acrobat 5, which you can get from Innotek site www.innotek.de

If you decide for Acrobat 5 then you need to install:
- Innotek runtime (install first)
- Acrobat 5
Both packages are self-installing files. They do not need any additions to libpath, well they modify user.ini instead
I have no experience with installing Acrobat 5 on the web but other people on this forum will know more surely

Date: 01 Sep, 2005 on 09:43
Bille
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 2
since: 31 Aug, 2005
4. Re:Change config.sys
Reply to this topic with quote Modify your message
Hi !

It works! Many thanks to zirkon

@Radek:
We have to change to Microsoft XP till december 2005.
So there's no need to install an other version of Adobe Acrobat.
But thank you for the information.

Greetings from Germany
Bille

Date: 01 Sep, 2005 on 12:05
Change config.sys
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
All times are CET+1. < Prev. | P. 1 | Next >
Go to:
 

Powered by UltraBoard 2000 Standard Edition,
Copyright © UltraScripts.com, Inc. 1999-2000.
Home | Gallery | Forums | Services | Webmail | Archive | Links | Contact Us | About Us
© OS2 World.Com 2000-2004